Language:
Русский
English
{SeekEof.PAS}
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
{Sample code for the SeekEof and SeekEoln functions.}
uses WinCrt;
var
f : Text;
i, j : Integer;
begin
Assign(f,'TEST.TXT');
Rewrite(f);
{ Create a file with 8 numbers and some
whitespace at the ends of the lines }
Writeln(f,'1 2 3 4 ');
Writeln(f,'5 6 7 8 ');
Reset(f);
{ Read the numbers back. SeekEoln returns
TRUE if there are no more numbers on
the current line; SeekEof returns TRUE
if there is no more text (other than
whitespace) in the file. }
while not SeekEof(f) do
begin
if SeekEoln(f) then
Readln; { Go to next line }
Read(f,j);
Writeln(j);
end;
end.