Technical Information

Application Development Manual | Reading from data files

Reading from data files

Function

Read record from data file.

Syntax

Detailed Description

The GET statement reads a record from the data file and splits the data among the field variables defined in the FIELD statement.

Set fileno to the value specified when opening the data file.

recordno specifies the record to read. If this parameter is omitted, the BHT uses the current record number +1, reading the next record.

Example

Read record #3 from the following data file

  private SNO$
private QTY$
private BARDATA$
open "TESTDATA.DAT" as #1                       ' open data file
field #1, 3 as SNO$, 5 as QTY$, 13 as BARDATA$  ' define fields
get #1,3                                        ' read from data file
print SNO$                                      ' displays 3
print QTY$                                      ' displays 10
print BARDATA$                                  ' displays 4901234567890

Contact us

QBdirect