Syntax |
Resume {[0] | Next | label} |
Description |
Ends an error handler and continues execution. |
Comments |
The form Resume 0 (or simply Resume by itself) causes execution to continue with the statement that caused the error. The form Resume Next causes execution to continue with the statement following the statement that caused the error. |
|
The form Resume label causes execution to continue at the specified label. The Resume statement resets the error state. This means that, after executing this statement, new errors can be generated and trapped as normal. |
Example |
This example accepts two integers from the user and attempts to multiply the numbers together. If either number is larger than an integer, the program processes an error routine and then continues program execution at a specific section using 'Resume <label>'. Another error trap is then set using 'Resume Next'. The new error trap will clear any previous error branching and also 'tell' the program to continue execution of the program even if an error is encountered. Sub Main() Again: If err = 0 Then Exit Sub
Overflow: 'Error
handler. |
See Also |
Error Handling (topic); On Error (statement). |
R |