Description

An operation allowing assignment to a sub-array of a Variant or McObject Value.

Return Type

None  

Syntax

object.McOpAssignSelected LeftOperand, RightOperand, [varSelector0], [varSelector1], [varSelector2], [varSelector3]

The McOpAssignSelected Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McOMGlobal.
LeftOperandRequired. A Variant value.

Left operand. An array of any numeric type. It may also be an McObject instance of a numeric type.

RightOperandRequired. A Variant value.

Right operand. May be a scalar or array of any numeric type. It may also be an McObject instance of a numeric type.

varSelector0Optional. A Variant value.

Optional selector for dimension 0 of vector data. Dim0 is the slowest moving dimension. If other selector arguments are missing and the number of dimensions in the selectors shape matches the number of dimensions in the Shape property, then selector values are treated as indices into the values unrolled into a 1-dimensional array.

varSelector1Optional. A Variant value.

Optional selector for dimension 1 of vector data.

varSelector2Optional. A Variant value.

Optional selector for dimension 2 of vector data.

varSelector3Optional. A Variant value.

Optional selector for dimension 3 of vector data.

Remarks

Up to 4 dimensions of optional index selectors may be supplied for vector data. If selectors are supplied, then the selected sub-array is assigned to as the left-hand operand for the assignment. 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 LeftOperand Variant's or 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.

On assignment, if all selector values are missing, then variable dimensions are allowed to change size on the assignment to accomodate the source data, but the number of dimensions is not allowed to change nor is the fixed or variable attribute of each dimension. Assigning to the Value property of a McObject sets the full shape of the stored data, as does assigning a shape directly to the McObject.Shape property.