Programming instructions
67
Intermec Fingerprint 6.13 – Programmer's Guide
7. INPUT TO FINGERPRINT, cont'd.
5. Input from a Random
File
Continued!
The following instructions are used in connection with input from
random files:
OPEN Creates and/or opens a file for RANDOM
access and optionally specifies the record
length in bytes.
FIELD Creates a random buffer, divides it into
fields and assigns a variable to each field.
GET Reads a record from the buffer to the file.
CLOSE Closes an OPENed file.
LOC Returns the number of the last record read
by the use of a GET statements in the
specified file.
LOF Returns the length in bytes of the speci-
fied file.
OPEN
To read the data stored in a random file, you must OPEN it.
The example in this chapter uses the random file created in chapter
8.4, which can be graphically illustrated like this:
10 OPEN "ZFILE" AS #1 LEN=14
The appending “LEN=14” refers to the length of each record which
is 14 bytes (4 + 4 + 6). Do not confuse the “LEN” parameter in the
OPEN statement with the LEN function, see chapter 9.2.
FIELD
Then enter the same field definitions as when the data was put into
the file:
20 FIELD#1, 4 AS F1$, 4 AS F2$, 6 AS F3$
GET
Use a GET statement to copy the desired record from the file. Note
that you can select whatever record you want, as opposed to
sequential files, where you reads the records one after the other. In
this case, we will copy record No. 1 (compare with the illustration
above).
30 GET #1,1
If you like, you can copy data from other records in the same file by
issuing additional GET statements with references to the records in
question.