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. A Resume in the handler an On Error GoTo branched to ends it, and the
policy is the one the handler is to have after it: to go to that label again, unless an On Error statement the
handler ran said otherwise (RD-VBAL §5.4.4.1).
An On Error GoTo -1 ended the handler already: there is no active error, and the Resume is error 20.
Execution continues where the Resume form 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: past End Select, when the error is in a Select Case's selector.
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.