Contains(Value: Variant): Boolean;
Value - value of the element, which existence should be checked.
The Contains method checks if the element, which value is passed by the Value parameter, exists in a queue.
Sub Main;
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 Main;
After executing the example a queue of random elements is created. The "s" variable is set to Yes if a queue contains an element with the Value 25 value.
See also: