bas7advr.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.
RESUME Statement Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Resumes program execution after an error-handling routine is finished.
 
RESUME { [0] | NEXT | line }
 
Usage Notes
    ■ The location where execution resumes is based on the location of the
      error handler in which the error is trapped, not on the location
      where the error occurred.
    ■ The following table summarizes the resumption rules for the RESUME[0]
      statement:
 
        Error handler        Location of error     Where program resumes
        ═════════════════    ══════════════════    ═════════════════════════
        Local                Same procedure        Statement that caused
                                                   error
 
        Module level         Same module           Statement that caused
                                                   error
 
        Local or module      Another procedure,    Statement that last
        level                same or another       called out of the
                             module                procedure or module
                                                   that contains the
                                                   error handler
 
    ■ NOTE:  If BASIC had to search for the error handler (the error handler
             that contains the RESUME statement is in a procedure or module
             other than the one in which the error occurred), then the last
             statement executed in that procedure (or module) is the last
             call out of that procedure or module.
    ■ As a rule, avoid using a line argument with a RESUME statement
      in a module-level error handler, unless you expect errors to occur
      only at the module-level.
    ■ A RESUME statement that is not in an error-handling routine
      produces the error message, "RESUME without error."
    ■ When an error-handling routine is active, if the end of the program
      text is encountered before executing a RESUME statement, BASIC
      generates the error message, "No RESUME." This also is true if
      an END statement (or an END SUB, END FUNCTION, or END DEF statement
      for a local error handler) is executed before a RESUME.
    ■ Programs that contain error-handling routines must be compiled with
      either the /E (On Error) or /X (Resume Next) options when you are
      compiling from the BC command line.