Skip to content

GET

Syntax

GET [#]<file number>[,<record number>]

Versions: Disk

Purpose

To read a record from a random disk file into a random buffer.

Remarks

is the number under which the file was OPENed. If is omitted, the next record (after the last GET) is read into the buffer. The largest possible record number is 32767.

Example

10 OPEN "R", 1, "INVENTORY.DAT", 128
20 FIELD #1, 20 AS ITEM$, 4 AS PRICE$, 2 AS QTY$
30 GET #1, 5  ' Read record 5 into buffer
40 PRINT "Item: "; ITEM$
50 PRINT "Price: "; CVS(PRICE$)
60 PRINT "Quantity: "; CVI(QTY$)

Note: After a GET statement, INPUT# and LINE INPUT# may be used to read characters from the random file buffer.

See Also

  • PUT - Write a random file record
  • FIELD - Define field variables for random file
  • OPEN - Open a random access file
  • LSET - Left-justify strings in a field
  • RSET - Right-justify strings in a field
  • CVI, CVS, CVD - Convert field strings to numbers
  • LOC - Get next record number for random files
  • LOF - Get file length
  • EOF - Test for end of file
  • CLOSE - Close file when done