Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
ON ERROR Statement
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Enables error handling and, when a run-time error occurs, directs your
program to either branch to an error-handling routine or to resume
execution.
ON [LOCAL] ERROR {GOTO line | RESUME NEXT | GOTO 0}
■ LOCAL Indicates an error-handling routine in the same
procedure; if omitted, module-level error handlers
are indicated
■ GOTO line Branches to the first line of the error-handling
routine, specified by a label or line number; to
disable error handling, specify GOTO 0
■ RESUME NEXT Resumes execution with the statement following the
statement that caused the run-time error; use the ERR
function to obtain the error code for the error
■ GOTO 0 Disables any enabled module-level error-handling
routine within the current module; if used with the
LOCAL keyword, disables any enabled error handler in
the current procedure
See Also
◄ERL Function► ◄ERR Function►
◄ERROR$ Function► ◄Error/Event Trapping Summary►
◄LOCAL Keyword►