5.4.4.3 Error Statement
Note
This section describes the implementation of MS-VBAL §5.4.4.3 Error Statement.
Syntax
| AST node | Instruction kind(s) | Notes |
|---|---|---|
| ErrorStatementNode | RaiseError |
Error <number>. |
See RD-VBAL §3.4.2 Simple Statements and RD-VBAL §3.5.2 Instruction.
Runtime Semantics
Error <number> raises a run-time error directly. MS-VBAL specifies that the Error statement raises the error
"as if Err.Raise were invoked".
- The number expression is evaluated, and Let-coerced to
Integer. - A run-time error with that number is raised.
The raised error is an application error: a custom run-time error explicitly raised from workspace source code with
Error or Err.Raise. See RD-VBAL §2.6.3 Runtime Errors.
Like every other run-time error, the raised error passes through the executor's error interception and is catchable by an error handler; see RD-VBAL §5.4.4.1 On Error Statement.
Implementation
RDCore.Runtime.Execution.ErrorHandlingEvaluator Let-coerces the Error statement's number expression to
Integer. It does so by a direct strategy call, the same way ConditionEvaluator forces a condition to Boolean
(see RD-VBAL §3.5.4 Execution).
| Type or member | Role |
|---|---|
ErrorHandlingEvaluator |
Evaluates the number expression and Let-coerces it to Integer, calling the numeric Let-coercion strategy (VBNumericLetCoercionTypeRuntimeSemantics) directly. |
| VBApplicationErrorInfo | The source metadata of an application error (RDCore.SDK). |
⏮️ RD-VBAL §5.4.4.2 Resume Statement | ⏭️ RD-VBAL §5.4.5 File Statements