Programming instructions

91
Intermec Fingerprint 6.13 – Programmer's Guide
8. OUTPUT FROM FINGERPRINT, cont'd.
4. Output to Random
Files, cont'd.
PUT, cont'd.
In our example, the file ZFILE was OPENed as #1 and we want to
place the data in the first record. Note that you can place data in
whatever record you like. The order is of no consequence.
90 PUT #1,1
If you want, you can continue and place data into other records using
additional sets of LSET, RSET and PUT statements. Below is a
graphic example of a three-record file:
CLOSE
When you are finished, close the file:
100 CLOSE #1
Nothing will actually happen before you execute the program using
a RUN statement. Then the data will be placed into the fields and
records as specified by the program, e.g.:
10 OPEN "ZFILE" AS #1 LEN=14
20 FIELD#1, 4 AS F1$, 4 AS F2$, 6 AS F3$
30 QDATA1$="ABC"
40 QDATA2$="DEF"
50 QDATA3$="12345678"
60 LSET F1$=QDATA1$
70 RSET F2$=QDATA2$
80 LSET F3$=QDATA3$
90 PUT #1,1
100 CLOSE #1
RUN
LOC (Locate)
The LOC function returns the number of the last record read or
written by the use of GET or PUT statements respectively in an
OPENed file.
This example closes the file "ADDRESSES" when record No. 100
has been read from the file:
10 OPEN "ADDRESSES" AS #1
.....
200 IF LOC(1)=100 THEN CLOSE #1
.....
LOF (Length-of-File)
The LOF function returns the length in bytes of an OPENed file.
The example illustrates how the length of the file "Pricelist" is
returned:
10 OPEN "PRICELIST" AS #5
20 PRINT LOF(5)
.....