Up to 4 dimensions of optional index selectors may be supplied for vector data. If selectors are supplied, then the selected sub-array is returned as the value. The dimension selector may be a single, scalar index value or it may be an array of such values; negative indices in a selector are legal, but they are ignored. If the selector for a dimension is missing (VT_EMPTY, VT_ERROR or VT_NULL) then all elements of that dimension will be selected.
For N-dimensional shaped McObject's, it is possible to supply selector values as indexes into the shape unwrapped into 1-dimensional array. This is done by supplying only the varSelector0 argument (leaving the other arguments missing) and supplying it as a N-dimensional array (if varSelector0 is supplied as a scalar or 1-D array, then it selects only from Dimension 0). The result of selecting in this way is a 1-dimensional array of the selected elements. This situation is actually a very common one, since the logical vector operators (e.g., McOMGlobal.McOpEq) preserve the shape of the left argument. The samples illustrate this and other selection rules: they are well worth examining if you are selecting from anything but 1-dimensional arrays.
The selector arguments are supplied in C/C++ order for multidimensional shaped objects. That is, the left-most argument selects into Dim0, the slowest moving dimension. This is the same ordering as in C/C++, but it is the reverse of dimension ordering in VB.
The returned subvector can differ subtly in its shape depending on whether a length-1 dimension selector is supplied as a length-1 array or as a scalar index value. If supplied as a scalar value, then the selected dimension is removed from the returned shape (the dimensionality drops by one), if supplied as an array, the dimension is kept and the returned value is always an array.
A missing (e.g., VT_ERROR) selector on a variable inner dimension of a multidimensional object will always preserve the dimension and will always expose it as an array of VARIANT's if the mcobjUserFlagAlwaysVector UserFlags bit is set; if the mcobjUserFlagAlwaysVector UserFlags bit is clear then the dimension will be exposed as an array of VARIANT's only if the sizes of the elements of the dimension actually vary.