Array.lastIndex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the highest index that is used to store a value in the array.
public:
int lastIndex();
public int lastIndex ();
member this.lastIndex : unit -> int
Public Function lastIndex () As Integer
Returns
An integer that represents the highest index that is used to store a value.
Remarks
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);
}