IStack.ToArray

Syntax

ToArray: Array;

Description

The ToArray method converts a stack into a standard array.

Example

Sub Main;

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 Main;

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

See also:

IStack