eof -- check, if an open file contains data
if (eof(1)) then
The eof-function checks, if there is still data left within an open file. As an argument it expects the file-number as returned by (or used within) the open-function (or statement).
This example will print the contents of the file "foo.bar". The eof-function will terminate the loop, if there is no more data left within the file.