ISortedList.SetByIndex

Syntax

SetByIndex(Index: Integer; Value: Variant);

Parameters

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

Value. New element value that should be set.

Description

The SetByIndex method changes element value.

Example

Sub UserProc;
Var
    SortList: ISortedList;
    i: Integer;
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;
    SortList.SetByIndex(SortList.Count - 1"Last Element");
End Sub UserProc;

After executing the example the value of the last element is modified.

See also:

ISortedList