qbasic.hlp (Topic list)
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
  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 resume execution.
 
ON ERROR {GOTO line | RESUME NEXT}
 
    ■ 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.
 
    ■ If ON ERROR isn't used, any run-time error ends your program.
 
Example
 
See Also    ERDEV, ERDEV$    ERR, ERL    ERROR    GOTO    RESUME