Share via


COMVariant.createFromArray Method

Definition

Overloads

createFromArray(Array)

Creates a new COMVariant object and initializes it with an array in one operation.

createFromArray(Array, COMVariantInOut)

createFromArray(Array)

Creates a new COMVariant object and initializes it with an array in one operation.

public:
 static Dynamics::AX::Application::COMVariant ^ createFromArray(Microsoft::Dynamics::Ax::Xpp::Array ^ array1);
public static Dynamics.AX.Application.COMVariant createFromArray (Microsoft.Dynamics.Ax.Xpp.Array array1);
static member createFromArray : Microsoft.Dynamics.Ax.Xpp.Array -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromArray (array1 As Array) As COMVariant

Parameters

array1
Array

Returns

The new COMVariant object.

Remarks

The COMVariant object that is created by this method has the data type VT_SAFEARRAY (array). You can change the data type of an existing COMVariant object to VT_SAFEARRAY by using the variantType method or by passing in an array value by using the safeArray property method.

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); 
}

Applies to

createFromArray(Array, COMVariantInOut)

public:
 static Dynamics::AX::Application::COMVariant ^ createFromArray(Microsoft::Dynamics::Ax::Xpp::Array ^ _value, Dynamics::AX::Application::COMVariantInOut _inOutFlag);
public static Dynamics.AX.Application.COMVariant createFromArray (Microsoft.Dynamics.Ax.Xpp.Array _value, Dynamics.AX.Application.COMVariantInOut _inOutFlag);
static member createFromArray : Microsoft.Dynamics.Ax.Xpp.Array * Dynamics.AX.Application.COMVariantInOut -> Dynamics.AX.Application.COMVariant
Public Shared Function createFromArray (_value As Array, _inOutFlag As COMVariantInOut) As COMVariant

Parameters

_value
Array

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:

_inOutFlag
COMVariantInOut

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:

Returns

Applies to