Programming instructions

38
Intermec Fingerprint 6.13 – Programmer's Guide
Continued!
5. FINGERPRINT PROGRAMMING, cont'd.
8. Conditional Branching,
cont'd.
Two instructions are used to branch to and from an error-handling
subroutine when an error occurs:
ON ERROR GOTO
This statement branches the execution to a specified line when any
kind of error occurs, ignoring the standard error-trapping routine. If
line number is specified as 0, the standard error-trapping routine
will be used.
RESUME
The RESUME statement is used to resume the program execution
after an error-handling subroutine has been executed. RESUME is
only used in connection with ON ERROR GOTO statements and
can be used in five different ways:
RESUME Execution is resumed at the state-
ment where the error occurred.
RESUME 0 Same as RESUME.
RESUME NEXT Execution is resumed at the state-
ment immediately following the
one that caused the error.
RESUME <ncon> Execution is resumed at the speci-
fied line.
RESUME <line label> Execution is resumed at the speci-
fied line label.
This example shows branching to a subroutine when an error has
occurred. The subroutine determines the type of error and takes the
appropriate action. In this example only one error; “1019 Invalid
font” is checked. After the error is cleared by substituting the
missing font, the execution will be resumed.
10 ON ERROR GOTO 1000
20 PRTXT "HELLO"
30 PRINTFEED
40 END
1000 IF ERR=1019 THEN FONT "SW030RSN" ELSE GOTO 2000
1010 PRINT "Substitutes missing font"
1020 FOR A%=1 TO 3
1030 SOUND 440,50
1040 SOUND 359,50
1050 NEXT A%
1060 RESUME
2000 PRINT "Undefined error, execution terminated"
2010 END
RUN
Branching at Errors
Also see:
Chapter 16.3