ContainsValue(Value: Variant): Boolean;
Value. Value of the element, which presence should be checked.
TheContainsValue method checks is there is an element with the specified value.
Sub UserProc;
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.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: