Description

For data objects, the Shape property reflects and sets the number of dimensions, and the size and characteristics of those dimensions.

Property type

A Variant value.  

Syntax

object.Shape([eShapeInfoControl]) [= value]

The Shape Property syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McObject.
eShapeInfoControlOptional. A mcobjShapeInfoControl enumeration, as described in settings.

0. A control value that deterimines what aspects of object shape are exposed as the Shape property. This argument has no effect on Shape assignment, but it must be supplied as mcobjSIC_Default.

valueA Variant value.

Settings

The settings for eShapeInfoControl are:

ConstantValueDescription
 mcobjSIC_Default0

Default Shape information is the same as mcobjSIC_SizeDim1, below. Use this as the argument when assigning a new shape.

 mcobjSIC_SizeDim00

Size of Dim0 (slowest moving) is returned

 mcobjSIC_SizeDim11

Size(s) of any Dim1 (next slowest moving) is returned. For all dimensions other than the slowest moving (Dim0, above), if the dimension has size elements that vary then the element sizes will be returned as a 1-D array of these sizes, otherwise the size is returned as a scalar value; this scalar value will be positive if the dimension size is FIX'ed and it will be negative or zero if the dimension is allowed to vary in size.

 mcobjSIC_SizeDim22

Size(s) of any Dim2 returned as for Dim1.

 mcobjSIC_SizeDim33

Size(s) of any Dim3 returned as for Dim1.

 mcobjSIC_SizeAllDims6

Sizes of all dimensions are returned encoded in a a 1-D array, with element zero representing Dim1 (the slowest moving). Sizes of fixed dimensions are returned as positive numbers, while sizes of variable dimensions holding only one element size are returned as a negative number or zero. Dimensions with varying size elements are returned as the special value of mcobjSIC_VaryingSizeCode (-0x7fffffff) as their size.

 mcobjSIC_NofDims7

The number of dimensions is returned. mcobjSIC_DimMayVaryMask = 8, A mask of dimensions which are allowed to vary is returned. Bit 0 is Dim0, the slowest moving dimension. The bit corresponding to each dimension is set if the dimension is allowed to vary.

 mcobjSIC_DimMayVaryMask8

a mask of dimensions which are allowed to vary is returned. Bit 0 is Dim1, the fastest moving dimension. The bit corresponding to each dimension is set if the dimension is allowed to vary.

 mcobjSIC_DimDoesVaryMask9

A mask of dimensions which actually have a varying number of elements is returned. Bit 0 is Dim0, the slowest moving dimension. The bit corresponding to each dimension is set if the dimension has a varying number of elements. The slowest moving dimension always has one size, so bit-0 will always be clear.

 mcobjSIC_VaryingSizeCode-2147483647

a code for dimension sizes that actually do vary, returned as a dimension size when mcobjSIC_SizeAllDims is specified as the eShapeInfoControl. This value may not be used as an argument.

Remarks

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.