Resume
Resume
allows you to end the execution of an error handling routine and resume the execution at the line that follows the line where the error was thrown.
Syntax
Resume
Examples
# Open a file, and handle the error
ERROR_FLAG=0
# OPEN_ERROR is the label used if the file cannot be opened (in a dedicated script ERRMGT)
Onerrgo OPEN_ERR From ERRMGT
# Let's open the file
Openi filpath("TXT","TEST","txt")
If ERROR_FLAG
End
Endif
# No more error management here
Onerrgo
...
End
# Extract of the ERRMGT script
$OPEN_ERROR
ERROR_FLAG=errn
ERROR_MSG=errmes$(errn)
Resume
Comments
Resume
is only usable if an error routing defined by Onerrgo
has been set and if an error was thrown.
The instruction where the execution resumes is the following:
- If the error was encountered in an If, the execution resumes after the Endif.
- If the error was encountered in a For, the execution resumes after the Next.
- If the error was encountered in a While, the execution resumes after the Wend.
- If the error was encountered in an Until, the execution resumes after the Until.
Associated errors
Error code | Description |
---|---|
32 | No error routing was done prior to the Resume execution. |
See also
Onerrgo, End, errn, errl, errp, errmes$.