QBasic 1.1: EOF Function
Explanation
EOF Function
Tests for the end of a file. EOF returns true (nonzero) if the end of a file has been reached.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
Description / Parameter(s)
filenumber% |
The number of an open file. |
Example
CLS
OPEN "TEST.DAT" FOR OUTPUT AS #1
FOR i% = 1 TO 10
WRITE #1, i%, 2 * i%, 5 * i%
NEXT i%
CLOSE #1
OPEN "TEST.DAT" FOR INPUT AS #1
DO
LINE INPUT #1, a$
PRINT a$
LOOP UNTIL (EOF(1))