ToArray: Array;
The ToArray method converts a stack into a standard array.
Sub UserProc;
Var
Stack1: IStack;
i: Integer;
Arr: Array Of Variant;
Begin
Stack1 := New Stack.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
Stack1.Push("Value " + Math.RandBetweenI(0, 100).ToString);
End For;
Arr := Stack1.ToArray;
End Sub UserProc;
After executing the example the generated stack is converted into the Arr array.
See also: