Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Array.lastIndex Method [AX 2012]

Retrieves the highest index that is used to store a value in the array.

public int lastIndex()

Run On

Called

Return Value

Type: int
An integer that represents the highest index that is used to store a value.

The following example uses the lastIndex method to find the last element in the array and then add a new value after this element.

{ 
    Array myArray = new Array(Types::Integer); 
    int newValue; 
 
    // Other code - values are added to myArray 
    // and a value is assigned to newValue 
  
    myArray.value(myArray.lastIndex()+1, newValue); 
}

Community Additions

ADD
Show:
© 2015 Microsoft