CorArray: CreateInstance |
Initializes a new array of the specified type in up to 3 dimensions.
Public Function CreateInstance( ByVal ElementType As VbVarType, Optional ByVal Length1 As Long = 0, Optional ByRef Length2 As Variant, Optional ByRef Length3 As Variant ) As Variant
Default: 0
If a length is zero, then an empty array is returned, not a Null array. If one length is defined as zero, then all other defined lengths must be zero. This does not mean that lengths 2 and 3 need to be set to zero if only an empty one-dimensional array is being created.
Exception | Condition |
---|---|
ArgumentException | ElementType is not a valid type. |
ArgumentOutOfRangeException |
Length1 is less than zero. -or- Length2 is less than zero. -or- Length3 is less than zero. |