Contains(Value: Variant): Boolean;
Value. Value of the element, which presence in the queue should be checked.
The Contains method checks presence of the element with the specified value.
The method returns True if there is an element with the specified value, and False if the element is missing.
Sub UserProc;
Var
Que: IQueue;
i: Integer;
s: String;
Begin
Que := New Queue.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
Que.Enqueue("Value " + Math.RandBetweenI(0, 100).ToString);
End For;
If Que.Contains("Value 25") Then
s := "Yes";
Else
s := "No";
End If;
End Sub UserProc;
After executing the example a queue of random elements is created. The "s" variable is set to Yes if the queue contains an element with the Value 25 value.
See also: