Programming instructions
87
Intermec Fingerprint 6.13 – Programmer's Guide
8. OUTPUT FROM FINGERPRINT, cont'd.
3. Output and Append to
Sequential Files, cont'd.
Continued!
After a file or device has been OPENed for OUTPUT or APPEND,
you can use the following instructions for writing data to it:
PRINT#
Prints data entered as string or numeric expressions to a sequential
file. Expressions can be separated by commas or semicolons:
• Commas prints the expression in separate zones.
• Semicolons prints expressions adjacently.
There are two ways to divide the file into records:
• Each PRINT# statement creates a new record (see line 20-40 in
the example below).
• Commas inside a string divides the string into records (see line 50
in the example below).
Example:
10 OPEN "QFILE" FOR OUTPUT AS #1
20 PRINT #1, "Record A", "a", "b", "c"
30 PRINT #1, "Record B", 1, 2, 3
40 PRINT #1, "Record C", "x"; "y"; "z"
50 PRINT #1, "Record D,Record E,Record F"
PRINTONE#
Prints characters entered as decimal ASCII values according to the
selected character set to the selected file or device. This statement
is e.g. useful when the host cannot produce certain characters. Apart
from using ASCII values instead of string or numeric expressions,
the PRINTONE# works in the same way as the PRINT# statement.
Example (prints two records ”Hello” and “Goodbye” to "file1"):
10 OPEN "file1" FOR OUTPUT AS 55
20 PRINTONE#55,72;101;108;108;111
30 PRINTONE#55,71;111;111;100;98;121;101
CLOSE
After having written all the data you need to the file, CLOSE it using
the same reference number as when it was OPENed, e.g.:
10 OPEN "file1" FOR OUTPUT AS 55
20 PRINTONE#55,72;101;108;108;111
30 PRINTONE#55,71;111;111;100;98;121;101
40 CLOSE 55
LOC (Location)
The LOC function returns the number of 128-byte blocks, that have
been written since the file was OPENed.
This example closes the file "ADDRESSES" when record No. 100
has been read from the file:
10 OPEN "ADDRESSES" FOR OUTPUT AS #1
.....
200 IF LOC(1)=100 THEN CLOSE #1
.....