---------------------------------------------------------------------------
| 305 | } |
| 306 | //--------------------------------------------------------------------------- |
| 307 | void __fastcall TMainForm::SetFile(String f) |
| 308 | { |
| 309 | TWaitCursor wait; |
| 310 | |
| 311 | in.Close(); |
| 312 | fFile = f; |
| 313 | Clear(); |
| 314 | // important OPEN_ALWAYS |
| 315 | in.Open(fFile, GENERIC_READ, |
| 316 | FILE_SHARE_READ | FILE_SHARE_WRITE, |
| 317 | OPEN_ALWAYS, |
| 318 | FILE_ATTRIBUTE_NORMAL); |
| 319 | if( !in ) |
| 320 | return; |
| 321 | |
| 322 | FileSize = in.GetSize64(); |
| 323 | // Since the beginning of the file, look at the size limit |
| 324 | if( FileSize > (ULONGLONG)SizeToRead ) |
| 325 | { |
| 326 | aMoreLines->Enabled = true; |
| 327 | |
| 328 | in.Pointer64 = FileSize - SizeToRead; |
| 329 | // Positioning at the beginning of a new line in the file |
| 330 | GotoNewLine(); |
| 331 | } |
| 332 | else |
| 333 | { |
| 334 | aMoreLines->Enabled = false; |
| 335 | } |
| 336 | |
| 337 | Read(true); // limit lines count off: show all readed lines |
| 338 | |
| 339 | UpdateDislpayInfo(); |
| 340 | } |
| 341 | //--------------------------------------------------------------------------- |
| 342 | void __fastcall PreRotateFile(String FileName) |
| 343 | { |
no test coverage detected