info.mailtraq.com > Management > Script Functions A-Z > EOF() EOF()Determines whether any data remains available in a file, i.e. whether the file pointer has reached beyond the last line of the specified file. EOF() operates on the file handle of a previously opened file and is normally used within a loop in conjunction with the Read() function to retrieve the contents of a text file.
Boolean := EOF( handle )
- handle
- The file identifier returned by a call to the OpenFile() function
- Boolean
- "FALSE" if there is more data to be read. "TRUE" if the end of the file has been reached
//Read the entire contents of a text file, input.txt, into the variable "my_text"
a := OpenFile("input.txt");
While(Not(EOF(a)),
my_text := my_text ++ Read(a) ++ "\n"
);
CloseFile(a) |