GetByIndex(Index: Integer): Variant;
Index. Index of the element, which value should be obtained.
The GetByIndex method returns value of the element with the specified index.
Sub UserProc;
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 UserProc;
After executing the example the "v" variable contains value of the first element of the array.
See also: