ISortedList.ContainsKey

Syntax

ContainsKey(Key: Variant): Boolean;

Parameters

Key. Key of the element, which presence should be checked.

Description

The ContainsKey method checks if there is an element with the specified key.

Example

Sub UserProc;
Var
    SortList: ISortedList;
    i: Integer;
    s: String;
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;
    If SortList.ContainsKey("Key_25"Then
        s := "Yes";
    Else
        s := "No";
    End If;
End Sub UserProc

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

See also:

ISortedList