A new, unnamed temporary McObject of the specified data type is created and then optionally shaped as an N-dimensional array. The values (if any) are initialized to zero.
If no array shape is supplied, the new object will be a zero-length, one dimensional array of the given type. This will often be useful if you are concatenating values to build up some array of values.
The returned McObject will have the mcobjUserFlagAlwaysVector set in its UserFlags property, so that even length-1 arrays are treated as vectors. You may clear this flag if you wish a length-1 array to be treated as a scalar.
The newly created McObject will be unnamed and have no ParentMcObject, and it will not be part of the McObjects collection, so it cannot be looked up via the Item property nor will it appear in any enumeration. If any of this is a problem, call the McObjects.Add method directly to create an object that is part of the collection. Use the McObject.RemoveFromCollection method to remove the new instance from the collection, effectively making it a temporary object. You may then assign to the McObject.Shape property to set the shape of the object.
To set a new shape for an object supply the varDimensionSizes argument as an array of values, one size for each dimension (for one-dimensional shapes, either a scalar value or an length-1 array can be passed in). The last element in the assigned array is the fastest moving dimension (this corresponds to dimension number 1 that would be passed to the VB UBound or LBound functions). That is, the dimension ordering of this array corresponds to C/C++ (or almost all other languages other than VB or FORTRAN) dimension ordering, where the first (left-most) dimension size is the slowest moving, row dimension.
If the assigned dimension size value is positive, then the corresponding dimension is made fixed. Fixed dimensions are not allowed to change size when assigned via the SelectedValues property with all missing selector arguments (or when the OpBareAssign method is called).
If the value is zero or negative, then the corresponding dimension is made variable, with all elements having an initial size equal to the absolute value of the given size. Variable dimensions can have varing size elements, and the slowest moving dimension can change size.