BASIC
The ON ERROR
GOTO
statement can
be
disabled
by
executing an ON ERROR GOTO 0.
If you use this inside an error-trapping routine, BASIC will handle the current error
normally.
The error handling routine
must be
terminated
by a
RESUME statement. See
RESUME.
RESUME line number
Terminates an error handling routine by
specifying where normal execution is to
resume.
RESUME without a line number and RESUME cause the
Computer to return to the
statement in which the error occurred.
RESUME followed
by a
line number causes the Computer to
branch to the specified
line number.
RESUME
NEXT causes the Computer to
branch to the statement following the point
at
which
the error occurred.
Sample Program with an Error Handling
Routine
605 ON
ERROR
GOTO
640
610 INPUT
"SEEKING
SQUARE
ROOT OF";
X
620 PRINT
SQR(X)
630 GOTO
610
640 PRINT "IMAGINARY
ROOT:"; SQR(-X);
"
*
I"
650 RESUME 610
660 END
RUN
the program and try inputting
a
negative value.
You must place a RESUME statement at the end of your error trapping routine,
so
that later errors may
also be trapped.
159