IStack.ToArray

Syntax

ToArray: Array;

Description

The ToArray method converts a stack into a standard array.

Example

Sub UserProc;
Var
    Stack1: IStack;
    i: Integer;
    Arr: Array Of Variant;
Begin
    Stack1 := New Stack.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        Stack1.Push("Value " + Math.RandBetweenI(0100).ToString);
    End For;
    Arr := Stack1.ToArray;
End Sub UserProc;

After executing the example the generated stack is converted into the Arr array.

See also:

IStack