IArrayList.Item

Syntax

Item(Index: Integer): Variant;

Parameters

Index. Array element index.

Description

The Item property returns value of the element with the specified index.

Example

Sub UserProc;
Var
    ArrayL: IArrayList;
    i: Integer;
    v: Variant;
Begin
    ArrayL := New ArrayList.Create;
    For i := 0 To Math.RandBetweenI(0100Do
        ArrayL.Add(Math.RandBetweenI(0500));
    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:

IArrayList