IStack.Clone

Syntax

Clone: IStack;

Description

The Clone method creates a copy of the stack.

Example

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

After executing the example the Stack2 stack contains a copy of the Stack1 stack.

See also:

IStack