Programming instructions

119
Intermec Fingerprint 6.13 – Programmer's Guide
Continued!
Creating an Error File or Array
The last requirement is an error file or array that can store any errors
that may occur. If you use a data array, you must use an error array,
and if you use a data file, you must use an error file. The following
errors will be stored and presented in said order:
1 If an error occurs in a layout record, the number of the record
(1...nn) and the error number is placed in the error array or file.
2 If a data record cannot be used in a layout record, an the index of
the unused data record (0...nn) plus the error code -1 is placed in
the error array or file.
Error arrays must be large enough to accommodate all possible
errors. Thus, use a DIM statement to specify a one-dimensional
array with a number of elements that is twice the sum of all layout
records plus twice the sum of all data records. You should also
include some routine that reads the array, e.g.:
10 DIM QERR%(28)
20 QERR%(0)=0
.....
190 IF QERR%(1)=0 THEN GOTO 260
200 PRINT "-ERROR- LAYOUT 1"
210 I%=0
220 IF QERR%(I%)=0 THEN GOTO 260
230 PRINT "ERROR ";QERR%(I%+1);" in record ";QERR%(I%)
240 I%=I%+2
250 GOTO 220
260 PRINTFEED
Error files require a little more programming to handle the error
message, e.g.:
220 OPEN "ERRORS.DAT" FOR INPUT AS 10
230 IF EOF(10) THEN GOTO 280 ELSE GOTO 240
240 FOR A%=1 TO 28
250 INPUT #10, A$
260 PRINT A$
270 NEXT A%
280 PRINTFEED
Note that the loop in line 240 must be large enough to accommodate
all possible errors.
10. LABEL DESIGN, cont'd.
7. Layout Files, cont'd.
Arrays
Also see:
Chapter 6.10