IQueue.Enqueue

Syntax

Enqueue(Value: Variant);

Parameters

Value. Value that should be queued.

Description

The Enqueue method queues the element with the specified value.

Comments

Value is placed to the end of a queue.

Example

Sub UserProc;
Var
    Que: IQueue;
    i: Integer;
Begin
    Que := New Queue.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        Que.Enqueue("Value " + Math.RandBetweenI(0100).ToString);
    End For;
    For i := 0 To Math.RandBetweenI(050Do
        Que.Dequeue;
    End For;
    i := Que.Count;
End Sub UserProc;

After executing the example a queue of random elements is created, part of elements is extracted, and the "i" variable contains the number of elements left in the queue.

See also:

IQueue