COMVariant::createFromArray Method [AX 2012]
Creates a new COMVariant object and initializes it with an array in one operation.
client server public static COMVariant createFromArray(Array value, [COMVariantInOut inOutFlag])
Run On
CalledParameters
- value
- Type: Array Class
The array used to initialize the object.
- inOutFlag
- Type: COMVariantInOut Enumeration
A flag that determines whether the object can be used to pass data to a COM method or COM property, to receive data, or both. This parameter is optional.
Possible values are:
The following example creates a new COMVariant object and initializes it with an array of integers.
{
int i;
COMVariant var;
Array arr = new Array(Types::INTEGER);
for (i = 1; i <= 10; i++)
// Insert 10 values in the array
arr.value(i, i);
// Create and initialize a COMVariant object
var = COMVariant::createFromArray(arr);
}
Show: