From Clomosy Docs
ClomosyAdmin (talk | contribs) No edit summary |
ClomosyAdmin (talk | contribs) 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
function Eof(var FileHandle 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;
{
AssignFile(myFile, 'Test.txt');
ReWrite(myFile);
WriteLn(myFile, 'Hello');
WriteLn(myFile, 'World');
CloseFile(myFile);
Reset(myFile);
while (not Eof(myFile))
{
ReadLn(myFile);
}
CloseFile(myFile);
}