Item(Index: Integer): Variant;
Index. Array element index.
The Item property returns value of the element with the specified index.
Sub UserProc;
Var
ArrayL: IArrayList;
i: Integer;
v: Variant;
Begin
ArrayL := New ArrayList.Create;
For i := 0 To Math.RandBetweenI(0, 100) Do
ArrayL.Add(Math.RandBetweenI(0, 500));
End For;
v := ArrayL.Item(ArrayL.Count - 1);
End Sub UserProc;
After executing the example a dynamic array with random values is created, and the "v" variable contains value of the last element.
See also: