5.4.4.2 Resume Statement
Note
This section describes the implementation of MS-VBAL §5.4.4.2 Resume Statement.
Syntax
| AST node | Instruction kind(s) | Notes |
|---|---|---|
| ResumeStatementNode | ResumeCurrentStatement |
A bare Resume (LabelExpression is null), or Resume 0. |
ResumeStatementNode |
ResumeLabel |
Resume <label>. Target: the label's offset. |
| ResumeNextStatementNode | ResumeNext |
Resume Next. |
ResumeStatementNode.LabelExpressionis nullable.Resume Nexthas its own node type,ResumeNextStatementNode. It is not aResumeStatementNodewith a "Next" label.- The
0inResume 0is the same MS-VBAL §5.4.4.2 sentinel thatOn Error GoTo 0uses; see RD-VBAL §5.4.4.1 On Error Statement.
See RD-VBAL §3.4.2 Simple Statements and RD-VBAL §3.5.2 Instruction.
Static Semantics
| Condition | Compile error |
|---|---|
Resume names a label that is not defined, e.g. Resume Retry with no Retry:. |
VBC09309 — Label not defined |
To resolve VBC09309 for an undefined Resume label, define the label, or use Resume Next to continue after the
statement that failed. Resume 0 is not a jump, so VBC09309 is not raised for it.
Runtime Semantics
Resume, Resume Next and Resume <label> all require an active error. The active error and the offset of the
fault statement are held on the activation's
ErrorHandlerState; see
RD-VBAL §5.4.4.1 On Error Statement.
- If the activation has no active error, run-time error 20, "Resume without error", is raised.
- Otherwise, the active error is cleared.
- Execution continues where the
Resumeform says:
| Form | Instruction kind | Execution continues at |
|---|---|---|
Bare Resume |
ResumeCurrentStatement |
The fault statement, which is re-executed. |
Resume 0 |
ResumeCurrentStatement |
The fault statement, which is re-executed: Resume 0 behaves as a bare Resume. |
Resume Next |
ResumeNext |
The statement past the fault statement. |
Resume <label> |
ResumeLabel |
The label. |
| Condition | Run-time error |
|---|---|
Resume, Resume Next or Resume <label> executes without an active error. |
20 — Resume without error |
Implementation
| Type or member | Role |
|---|---|
RDCore.Runtime.Execution.ProcedureExecutor |
Dispatches ResumeCurrentStatement, ResumeNext and ResumeLabel. |
ErrorHandlerState.ActiveError, ErrorHandlerState.FaultStatementOffset |
The active error, and the offset of the fault statement (RDCore.SDK). |
VBRuntimeErrorId.ResumeWithoutError |
Run-time error 20. |
⏮️ RD-VBAL §5.4.4.1 On Error Statement | ⏭️ RD-VBAL §5.4.4.3 Error Statement