ISortedList.SetByIndex

Syntax

SetByIndex(Index: Integer; Value: Variant);

Parameters

Index - index of the element, which value should be modified.

Value - a new element value that should be set.

Description

The SetByIndex method changes value of the element, which index is passed by the Index parameter.

Example

Sub Main;

Var

SortList: ISortedList;

i: Integer;

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;

SortList.SetByIndex(SortList.Count-1,"Last Element");

End Sub Main;

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

See also:

ISortedList