Array.typeId Method

Returns the data type of the values in the array.

Syntax

public Types typeId()

Run On

Called

Return Value

Type: Types Enumeration
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.

Examples

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

See Also

Array Class

Array.new Method