ISortedList.ContainsValue

Syntax

ContainsValue(Value: Variant): Boolean;

Parameters

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

Description

TheContainsValue method checks is there is an element with the specified value.

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.ContainsValue("Number 50"Then
        s := "Yes";
    Else
        s := "No";
    End If;
End Sub UserProc;

After executing the example the "s" variable is set to Yes if generated sorted array contains element with the Number 50 value.

See also:

ISortedList