5.3.1.5 Parameter Lists
Note
This section describes the implementation of MS-VBAL §5.3.1.5 Parameter Lists.
Syntax
A declared parameter is a VBParameterSymbol;
a trailing ParamArray parameter is a
ParamArrayParameterSymbol.
The parameter list of a Property Let or Property Set follows this MS-VBAL §5.3.1.5 rule:
property-parameters = "(" [parameter-list ","] value-param ")"
Static Semantics
In the property-parameters rule, value-param is never bracketed, so it is always mandatory, whether or not
there are index parameters. A Property Let or Property Set with no parameters has no value parameter to
receive what is being assigned, and is reported as VBC09321. See also
RD-VBAL §5.3.1.7 Property Declarations.
👉 UDT values must be passed by reference (
ByRef). See RD-VBAL §2.5.2.1.3 User-Defined Type (UDT) Values.
Optional parameters
VBParameterSymbol.DefaultValue holds an Optional parameter's default value.
| Declaration | VBParameterSymbol.DefaultValue |
|---|---|
Optional with an = ... default-value clause |
The default value, pre-computed. |
Optional with no = ... default-value clause |
null |
When an Optional parameter has no argument mapped to it, the invocation uses VBParameterSymbol.DefaultValue
directly. When DefaultValue is null, it falls back to the parameter's declared type's default value. See
RD-VBAL §5.3.1.11 Procedure Invocation Argument Processing.
ParamArray parameters
How the arguments passed to a ParamArray parameter are collected is described in
RD-VBAL §5.3.1.11 Procedure Invocation Argument Processing.
⏮️ RD-VBAL §5.3.1.4 Function Type Declarations | ⏭️ RD-VBAL §5.3.1.6 Subroutine and Function Declarations