[next] [previous] [contents]

  19.2.2.5 Reading Records from a File
  The GET statement reads records into the buffer. The fol-
  lowing program reads a record into the buffer, prints a string
  field, and rewinds the file before closing. Successive GET op-
  erations read successive records. BASIC signals the error
  ``End of file on device'' (ERR=11) if you encounter a tape
  mark during a GET operation. If you trap this error and
  continue, you can skip over any tape marks. The system
  variable RECOUNT is set to the number of bytes transferred
  after each GET operation.
  OPEN "MT1:" FOR INPUT AS FILE #1%, ACCESS READ
  GET #1%
  MOVE FROM #1%, A$ = RECOUNT
  PRINT A$
  RESTORE #1%
  CLOSE #1%