From Clomosy Docs

Revision as of 14:12, 27 February 2023 by ClomosyManager (talk | contribs) (Created page with " function Eof(TextFile); The Eof function returns true if the file given by FileHandle is at the end.<br> The file must have been assigned, and opened with Reset. '''Example:'''<br> '''var''' myFile : TextFile;<br> '''begin''' AssignFile(myFile, 'Test.txt'); ReWrite(myFile);<br> WriteLn(myFile, 'Hello'); WriteLn(myFile, 'World'); CloseFile(myFile); Reset(myFile);<br> while not '''Eof'''(myFile) do begin ReadLn(myFile); end;<br> Cl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

function Eof(TextFile);

The Eof function returns true if the file given by FileHandle is at the end.
The file must have been assigned, and opened with Reset.

Example:

var
  myFile : TextFile;
begin AssignFile(myFile, 'Test.txt'); ReWrite(myFile);
WriteLn(myFile, 'Hello'); WriteLn(myFile, 'World'); CloseFile(myFile); Reset(myFile);
while not Eof(myFile) do begin ReadLn(myFile); end;
CloseFile(myFile); end;