Interface IVariableDefaults
What the storage of a declared variable starts as.
public interface IVariableDefaults
Remarks
For most variables that is the default value of the declared type. For an array it is more than the type can say: a
fixed-size array is as big as its declaration's bounds (MS-VBAL §5.2.3.1.3), constant expressions that may
name a Const and so have to be reduced, and an array of Long that has no dimensions yet is still an array of
Long. Whatever allocates storage for a variable asks this, which is what keeps that in one place.
An optional parameter is a variable too, and the call that omits its argument is what allocates it: it starts as its
declared default (MS-VBAL §5.3.1.5), or, declaring none, as the Missing value when it is a Variant
(MS-VBAL §6.1.2.7.1.6) and its type's default value otherwise.
Methods
DefaultValueOf(Symbol)
The value the storage of variable starts as: its type's default value, except for an array and an
optional parameter whose argument is omitted.
VBTypedValue DefaultValueOf(Symbol variable)
Parameters
variableSymbolThe variable, which is typed.
Returns
ElementCellOf(VBType)
The cell each element of an array of itemType is stored in, when the runtime stores elements of that type in cells of its own -
a representation of the value it can read and write without making a value of it each time - rather than in a cell that holds the value as it is.
Func<IBindingHandle>? ElementCellOf(VBType itemType)
Parameters
itemTypeVBTypeThe element type of the array.
Returns
- Func<IBindingHandle>
Makes one cell; null, the default, for a cell that holds the value as it is.
Remarks
What an element is, its default value and how it is read, written and passed by reference are the same either way: this only says where it is kept. The cell starts as the type's default value. An element that is a record is not kept in one: ElementDefaultOf(VBType) makes it.
ElementDefaultOf(VBType)
What each element of an array of itemType starts as, when it is more than the type's own default value: a record,
whose fields start as declared variables of them do - a fixed-size array field with its dimensions (MS-VBAL §5.2.3.3).
Func<VBTypedValue>? ElementDefaultOf(VBType itemType)
Parameters
itemTypeVBTypeThe element type of the array.
Returns
- Func<VBTypedValue>
Makes one element; null when the type's own default value is what an element starts as.