Specifies the line number to which execution branches when an error is generated.
ON ERROR GOTO branch destination line number
└─────────────┬──────────────┘
Line number
ON ERROR GOTO 1000
branch destination line number: Integer in the range of 0 ≦ line number ≦ 65535
ON ERROR GOTO
statement must be followed by a corresponding RESUME
statement in the same program area. Branching to another program area using
ON ERROR GOTO
generates an error when the RESUME statement in the
other program area is executed.10 ON ERROR GOTO 40
20 **ERROR**
30 END
40 PRINT "OOPS! ERROR!!!": BEEP 1
50 RESUME 30
Execution of line 40, followed by line 30 if error generated. The program shown here is only an error subroutine and does nothing by itself.