ISortedList.ContainsKey

Syntax

ContainsKey(Key: Variant): Boolean;

Parameters

Key - key of element, which existence should be checked.

Description

The ContainsKey method checks if the element with the Key key exists in array.

Example

Sub Main;

Var

SortList: ISortedList;

i: Integer;

s: String;

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;

If SortList.ContainsKey("Key_25") Then

s:="Yes";

Else

s:="No";

End If;

End Sub Main;

After executing the example the "s" variable is set to Yes, if generated sorted array contains an element with the Key_25 key.

See also:

ISortedList