cArray: CreateInstance |
Initializes a new array of the specified type in up to 3 dimensions.
Public Function CreateInstance( ByVal ArrayType As ciArrayTypes, 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 lenghts 2 and 3 need to be set to zero if only an empty one-dimensional array is being created.
Elements of a size that are a multiple of 4 will not create a new array when being returned. All other datatype sizes will cause a new array to be created. The array must also be assigned at the end of the code so VB can optimize returning the Variant datatype and not copy it when possible.
Project VBCorLib Overview Class cArray Overview cArray Properties cArray Methods CopyEx Exists