Description | Cause a trappable run-time error to jump to a label |
Syntax | On Error GoTo... |
Remarks | Various parameters indicate how errors are handled. Error trapping is turned off while in the body of the error-handler routine. If a run-time error occurs while processing the original error, execution is terminated immediately. You may find out what error was trapped by accessing the Err object. The number and description properties of the Err object are accessed in the same way as they are in Visual Basic. Err.number is the error number and Err.description is the error description. These properties can only be read, not modified. |
Example | 'This turns error trapping off, so a run-time error is a terminal condition: On Error GoTo 0 'This causes a trappable run-time error to jump to the label "errlabel": On Error GoTo errlabel |
Description | Cause a trappable run-time error to jump to the next line |
Syntax | On Error Resume Next... |
Remarks | Various parameters indicate how errors are handled. Error trapping is turned off while in the body of the error-handler routine. If a run-time error occurs while processing the original error, execution is terminated immediately. You may find out what error was trapped by accessing the Err Object Variable. The number and description properties of the Err object are accessed in the same way as they are in Visual Basic. Err.number is the error number and Err.description is the error description. These properties can only be read, not modified. |
Example | This causes a trappable run-time error to skip the rest of the currently executing statement: On Error Resume Next |
Description | Cause execution to branch back to the statement containing the label |
Syntax | …Resume [Label] |
Remarks | This statement is executed while in the body of an error handler. It causes error trapping to be restored to its previous state, for example: Goto errlabel. If this statement is executed while an error handler is not active, an untrappable run-time error occurs. Error trapping is turned off while in the body of the error-handler routine. If a run-time error occurs while processing the original error, execution is terminated immediately. Note: Labels must be left-justified. The label Errhandler cannot be indented in an expression. If labels are indented, an "undefined label" error occurs at run time. |
Example | This example causes the compiler to branch back to the Cont1 part of the code: On Error GoTo ErrHandler Dim Var Var = FieldAt("/SOURCE/R1/Customer") Cont1: Var = "No ID" LogMessage(Var) Return ErrHandler: LogMessage("in ErrHandler") Resume Cont18 |
Description | Cause execution to branch back to the beginning of the statement after the statement in which the run-time error occurred |
Syntax | …Resume Next |
Remarks | This statement is executed while in the body of an error handler. It causes error trapping to be restored to its previous state, for example: Goto errlabel. If this statement is executed while an error handler is not active, an untrappable run-time error occurs. Error trapping is turned off while in the body of the error-handler routine. If a run-time error occurs while processing the original error, execution is terminated immediately. |
Example | This causes a trappable run-time error to skip the rest of the currently executing statement. On Error Resume Next |
Description | Cause execution to branch back to the beginning of the statement in which the run-time error occurred |
Syntax | ...Resume... |
Remarks | This statement is executed while in the body of an error handler. It causes error trapping to be restored to its previous state, for example: Resume Next or Goto errlabel. If this statement is executed while an error handler is not active, an untrappable run-time error occurs. Error trapping is turned off while in the body of the error handler routine. So if a run-time error occurs while processing the original error, execution is terminated immediately. |
Example | On Error GoTo errorHandller errorHandller: <statement for get rid of the error> Resume |