Programming instructions
Intermec Fingerprint v7.61 – Programmer’s Reference Manual Ed. 7 177
Chapter 2 Program Instructions
ON ERROR GOTO
Field of Application
Statement for branching to an error-handling subroutine when
an error occurs.
Syntax ON
↔
ERROR
↔
GOTO<ncon>|<line label>
<ncon> is the number or label of the line to which the program should
branch when an error condition occurs.
Remarks
If any kind of error condition occurs after this statement has been
encountered, the standard error-trapping routine will be ignored and the
program will branch to the specifi ed line, which should be the fi rst line
in an error-handling subroutine.
If the line number is 0, the standard error-trapping routine will be enabled and
no error-branching within the current program will be executed.
Examples
If you try to run this example with the printhead raised (or if any
other error occurs), a warning signal will sound and the error LED
will be lighted.
10 LED 0 ON:LED 1 OFF
20 ON ERROR GOTO 1000
30 FONT "Swiss 721 BT"
40 PRTXT "HELLO"
50 PRINTFEED
60 END
. . . . .
1000 LED 0 OFF:LED 1 ON
1010 FOR A%=1 TO 3
1020 SOUND 440,50
1030 SOUND 359,50
1040 NEXT A%
1050 RESUME NEXT
The same example written without line numbers would look like this:
IMMEDIATE OFF
LED 0 ON:LED 1 OFF
ON ERROR GOTO QQQ
FONT "Swiss 721 BT"
PRTXT "HELLO"
PRINTFEED
END
. . . . .
QQQ: LED 0 OFF:LED 1 ON
FOR A%=1 TO 3
SOUND 440,50
SOUND 359,50
NEXT A%
RESUME NEXT
IMMEDIATE ON