5.4.2.19 Exit Property Statement
Note
This section describes the implementation of MS-VBAL §5.4.2.19 Exit Property Statement.
Syntax
| AST node | Instruction kind | Notes |
|---|---|---|
KeywordStatementNode (Token: "Exit Property") |
ExitProcedure |
No resolved target. |
Exit Property lowers to the same
InstructionKind as Exit Sub and
Exit Function: ExitProcedure (RD-VBAL §3.5.2 Instruction).
Static Semantics
An Exit Property must be inside the body of a property declaration (Property Get, Property Let or Property Set); in a Sub or a Function it is
VBC09315 (ExitPropertyNotAllowedInSubOrFunction). The rule is
ExitStatementStaticSemantics's, applied when the kind of the procedure is known
(RD-VBAL §5.4.2.18 Exit Function Statement).
Runtime Semantics
The executor dispatches the ExitProcedure instruction, as for Exit Sub
(RD-VBAL §5.4.2.17 Exit Sub Statement).
For a Property Get, the function result variable is read back however ExitProcedure was reached: an
explicit Exit Property, or reaching the end of the body. The value read back is the call's result
(RD-VBAL §5.3.1.11 Procedure Invocation Argument Processing).
Implementation
RDCore.Runtime.Execution.ProcedureExecutordispatchesExitProcedureinstructions.RDCore.Runtime.Execution.RuntimeProcedureInvokerreads the function result variable back from ICallStackFrame.ReturnValue.
⏮️ RD-VBAL §5.4.2.18 Exit Function Statement | ⏭️ RD-VBAL §5.4.2.20 RaiseEvent Statement