IQueue.Contains

Syntax

Contains(Value: Variant): Boolean;

Parameters

Value - value of the element, which existence should be checked.

Description

The Contains method checks if the element, which value is passed by the Value parameter, exists in a queue.

Example

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:

IQueue