IQueue.Contains

Syntax

Contains(Value: Variant): Boolean;

Parameters

Value. Value of the element, which presence in the queue should be checked.

Description

The Contains method checks presence of the element with the specified value.

Comments

The method returns True if there is an element with the specified value, and False if the element is missing.

Example

Sub UserProc;
Var
    Que: IQueue;
    i: Integer;
    s: String;
Begin
    Que := New Queue.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        Que.Enqueue("Value " + Math.RandBetweenI(0100).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:

IQueue