To set a new shape for an object assign from 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.
Assigned to the SelectedValues property with all missing selector arguments (or equivalently, calling the OpBareAssign method) can set variable dimension sizes (though not the number of dimensions) to match the assigning array. Dimension sizes are never changed when a OpSelfAssign call is made.
When examining the Shape property, you must supply an mcobjShapeInfoControl argument specifying what information you want about the shape. This argument must be missing (or the default) when assigning to the Shape property.
The mcobjUserFlagAlwaysVector bit in the UserFlags property controls whether length-1 arrays are treated as an array or a scalar. You may set this flag if you wish a length-1 array to be treated as an array instead of a scalar.