The Channel class / base.Channel methods |
Detect the end of a file.
isEof() RETURNING result BOOLEAN
Use the isEof() method to detect the end of a file while reading from a channel.
The end of file is only detected after the last read. In other words, you first read, then check for the end of file and process if not end of file.
DEFINE s STRING WHILE TRUE LET s = ch.readLine() IF ch.isEof() THEN EXIT WHILE END IF DISPLAY s END WHILE