From Clomosy Docs
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);
}