Programming instructions
90
Intermec Fingerprint 6.13 – Programmer's Guide
The file can consist of many records, all with the same format. (To
produces files with different record lengths, the file must be
OPENed more than once and with different reference numbers).
Now it is time to write some data to the file. Usually the data comes
from e.g. the host or from the printer's keyboard. In this example,
we will type the data directly on the host and assign the data to string
variables:
30 QDATA1$="ABC"
40 QDATA2$="DEF"
50 QDATA3$="12345678"
Note that only string variables can be used. Possible numeric
expressions must therefore be converted to strings by means of
STR$ functions.
LSET/RSET
There are two instructions for placing data into a random file buffer:
• LSET places the data left-justified.
• RSET places the data right-justified.
In other words, if the input data consist of less bytes that the field into
which it is placed, it will either be placed to the left (LSET) or to the
right (RSET).
If the length of the input data exceeds the size of the field, the data
will be truncated from the end in case of LSET, and from the start
in case of RSET.
60 LSET F1$=QDATA1$
70 RSET F2$=QDATA2$
80 LSET F3$=QDATA3$
Using the graphic illustration from previous page, the result is
meant to be like this:
Note that the first field is left-justified, the second field is right-
justified, and the third field is left-justified and truncated at the end
(digits 7 and 8 are omitted since the field is only six bytes long; if
the field had been right-justified, digits 1 and 2 had been omitted
instead).
PUT
Next step is to transfer the record to the file. For this purpose we use
the PUT statement. PUT is always followed by the number assigned
to the file when it was OPENed, and the number of the record in
which you want to place the data (1 or larger).
8. OUTPUT FROM FINGERPRINT, cont'd.
4. Output to Random
Files, cont'd.
Continued!
☞
STR$ Function
Also see:
• Chapter 9.2