The SeekEoln procedure skips past white space characters in the current record in an open text file given by FileHandle.
The file must have been assigned with AssignFile and opened with Reset.
If the end of line (Eoln) of the end of file (Eof) is thereby reached, the return value is True.
This function is normally used when reading unknown numbers of fields in a record in a file.
|SeekEoln is very similar to SeekEof - the only difference is that SeekEof only returns true when Eof is reached; SeekEoln also returns true when the line end is reached after skipping the white spaces.|
|Eof||Returns true if a file opened with Reset is at the end|
|Eoln||Returns true if the current text file is pointing at a line end|
|File||Defines a typed or untyped file|
|FilePos||Gives the file position in a binary or text file|
|Seek||Move the pointer in a binary file to a new record position|
|SeekEof||Skip to the end of the current line or file|
| Download this web site as a Windows program.
|Example code : Reading all fields in a record in a text file|
myFile : TextFile;
number : Integer;
// Try to open the Test.txt file for writing to
// Write numbers in a string
WriteLn(myFile, '1 2 3 4 '); // White space at the end
// Write numbers as separate parameters
WriteLn(myFile, 5, ' ', 6, ' ', 7, ' ');  // Results in '5 6 7 ' text
// Close the file
// Reopen the file for reading
// Display the file contents
while not SeekEof(myFile) do
// Read numbers one at a time
ShowMessage('Start of a new line');
while not SeekEoln(myFile) do
// Now move to the next line
// Close the file for the last time
|Show full unit code|
| Start of a new line
Start of a new line