Get Statement

       

Reads data from an open disk file into a variable.

Syntax

Get [#]filenumber, [recnumber], varname

The Get statement syntax has these parts:

Part Description
filenumber Required. Any valid file number.
recnumber Optional. Variant (Long). Record number (Random mode files) or byte number (Binary mode files) at which reading begins.
varname Required. Valid variable name into which data is read.

Remarks

Data read with Get is usually written to a file with Put.

The first record or byte in a file is at position 1, the second record or byte is at position 2, and so on. If you omit recnumber, the next record or byte following the last Get or Put statement (or pointed to by the last Seek function) is read. You must include delimiting commas, for example:

Get #4,,FileBuffer

For files opened in Random mode, the following rules apply:

For files opened in Binary mode, all of the Random rules apply, except: