Partilhar via


Array.typeId Method

Definition

Returns the data type of the values in the array.

public:
 Microsoft::Dynamics::Ax::Xpp::Types typeId();
public Microsoft.Dynamics.Ax.Xpp.Types typeId ();
member this.typeId : unit -> Microsoft.Dynamics.Ax.Xpp.Types
Public Function typeId () As Types

Returns

The data type of the elements in the array.

Remarks

The type remains the same throughout the life of the array. The type is specified when the array is created.

The following example tests whether a particular array element exists. If it does not exist, the typeId method is used to specify the type of the new value that should be added to the array.

public anytype getArrayValue(Array a, int _index) 
{ 
    if (! a.exists(_index)) 
    { 
        a.value(_index,nullValueFromType(a.typeId())); 
    } 
    return a.value(_index); 
}

Applies to