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, which index is passed by the Index parameter.

Example

Sub Main;

Var

SortList: ISortedList;

i: Integer;

v: Variant;

Begin

SortList:=New SortedList.Create;

For i:=0 To Math.RandBetweenI(50,100) Do

SortList.Add("Key_"+Math.RandBetweenI(0,100).ToString,"Number "+Math.RandBetweenI(0,100).ToString);

End For;

v:=SortList.GetByIndex(0);

End Sub Main;

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

See also:

ISortedList