IStack.Push

Syntax

Push(Value: Variant);

Parameters

Value. Value that should be placed to the stack.

Description

The Push method places the specified value to beginning of 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