mk90.basic.functions

Function EOF

Test the open INPUT data file for end-of-file.

Syntax

EOF

Returns

−1 after its final byte has been consumed, otherwise 0.

Behavior

Considers both unread bytes in the internal cache and the underlying file position. An empty input file reports EOF immediately. EOF does not consume a byte.

It requires a valid INPUT data handle. Use it before GET to avoid reading past the end.

Example

10 OPEN "bytes",INPUT
20 IF EOF THEN 60
30 GET A
40 PRINT A
50 GOTO 20
60 CLOSE
70 END

Limits and diagnostics

No file-number argument or parentheses. An invalid file state gives a data-file or handle error.

Status-code reference.

See also

Expressions and precedence · Runtime