IStack.Pop

Syntax

Pop: Variant;

Description

The Pop method gets value of the element placed to the stack as the last one.

Comments

After extracting the element is removed from the stack.

Example

Sub UserProc;
Var
    Stack1: IStack;
    i: Integer;
Begin
    Stack1 := New Stack.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        Stack1.Push("Value " + Math.RandBetweenI(0100).ToString);
    End For;
    For i := 0 To Math.RandBetweenI(050Do
        Stack1.Pop;
    End For;
    i := Stack1.Count;
End Sub UserProc;

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

See also:

IStack