IQueue.Peek

Syntax

Peek: Variant;

Description

The Peek method gets value of the element that is placed as the first one from a queue.

Comments

After extracting element is not removed from the queue.

Example

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

After executing the example a queue of random elements is created, and the "v" variable contains value of the first element placed to the queue.

See also:

IQueue