ContainsValue(Value: Variant): Boolean;
Value. Element value.
The ContainsValue method checks if there is an element with the specified value.
Sub UserProc;
Var
Hash: IHashtable;
i: Integer;
s: String;
Begin
Hash := New Hashtable.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
Hash.Add("Key_" + Math.RandBetweenI(0, 100).ToString, "Value " + Math.RandBetweenI(0, 100).ToString);
End For;
If Hash.ContainsValue("Value 25") Then
s := "Yes";
Else
s := "No";
End If;
End Sub UserProc;
After executing the example a hash table is generated, and the "s" variable is set to Yes, if it contains an element with the Value 25 value.
See also: