From Clomosy Docs

No edit summary
No edit summary
 
Line 34: Line 34:
<h2> See Also </h2>
<h2> See Also </h2>
* [[File_Handling | File Handling]]
* [[File_Handling | File Handling]]
{{#seo:|title=EOF Using in Clomosy - Clomosy Docs}}
{{#seo:|description=EOF checks if the given file handle is at the end of the file, returning true if it is.}}
{{#seo:|description=EOF checks if the given file handle is at the end of the file, returning true if it is.}}

Latest revision as of 14:04, 24 December 2024

The Eof function returns true if the file given by FileHandle is at the end.

Example

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

See Also