The ON ERROR statement transfers program control to a specified line or program module. If an error is pending when the ON ERROR statement executes, control is transferred immediately. Otherwise, control is transferred when an error occurs. For new program development, it is recommended that you use WHEN blocks.
1 – GOBACK
After BASIC executes an ON ERROR GO BACK in a subprogram or DEF, control transfers to the calling (main) program when an error occurs under certain conditions. Example ON ERROR GO BACK
1.1 – Syntax
{ ONERROR } { ON ERROR } GO BACK
2 – GOTO
The ON ERROR GOTO statement transfers program control to a specified line or label in the current program unit when an error occurs under certain conditions. Example 5 ON ERROR GOTO 19000
2.1 – Syntax
{ ONERROR } { GO TO } { ON ERROR } { GOTO } target
3 – GOTO 0
The ON ERROR GOTO 0 statement disables user error handling and passes control to the BASIC error handler when an error occurs under certain conditions. Example ON ERROR GOTO 0
3.1 – Syntax
{ GO TO } ON ERROR { GOTO } 0