NAME

get - read a record from random access file

SYNOPSIS

get [#]FileNum[, RecNum]

DESCRIPTION

Get reads a record from a file opened for random access into the file buffer.  FileNum may be any numeric expression and is assumed to be the number under which the file was opened.  RecNum is the record number of the record to be read.  If RecNum is omitted, get reads the next record following the previous get.  After a get statement, the data in the random file buffer can be accessed by referring to variables defined in a field statement for the same file number. 

EXAMPLE

The example
	10 open "cust" as #1 len = 150
	20 field 1, 30 as custname$, 30 as addr$, 35 as city$
	30 get 1
	40 print custname$, addr$, city$
opens the file "cust" for random access, with fields defined in line 20.  The get statement on line 30 reads a record into the file buffer.  Line 40 displays the information from the record that was read. 

SEE ALSO

field, lset, open, put, rset

DIAGNOSTICS

A "Bad file number" error occurs if FileNum is less than one or greater than the maximum allowed value. 

A "Bad file mode" error occurs if FileNum is not open for random access. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber