Item(Index: Integer): Variant;
Index. Array element index.
The Item property returns value of the element, which index is passed by the Index parameter.
Sub Main;
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 Main;
After executing the example a dynamic array with random values is created, and the "v" variable contains value of the last element.
See also: