Skip to content

EOF

Syntax

EOF(file number)

Versions: Disk

Description

Returns -1 (true) if the end of a sequential file has been reached. Use EOF to test for end-of-file while INPUTting, to avoid "Input past end" errors.

Example

10 OPEN "I", 1, "DATA"
20 C = 0
30 IF EOF(1) THEN 100
40 INPUT #1, M(C)
50 C = C + 1 : GOTO 30
100 CLOSE #1

See Also

  • OPEN - Open a file for input
  • INPUT# - Read data from sequential file
  • LINE INPUT# - Read entire line from file
  • CLOSE - Close file when done
  • LOC - Get current file position
  • LOF - Get file length