ISortedList.GetByIndex

Syntax

GetByIndex(Index: Integer): Variant;

Parameters

Index. Index of the element, which value should be obtained.

Description

The GetByIndex method returns value of the element with the specified index.

Example

Sub UserProc;
Var
    SortList: ISortedList;
    i: Integer;
    v: Variant;
Begin
    SortList := New SortedList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        SortList.Add("Key_" + Math.RandBetweenI(0100).ToString, "Number " + Math.RandBetweenI(0100).ToString);
    End For;
    v := SortList.GetByIndex(0);
End Sub UserProc;

After executing the example the "v" variable contains value of the first element of the array.

See also:

ISortedList