IArrayList.ToArray

Syntax

ToArray: Array;

Description

The ToArray method converts into standard array.

Comments

If the current dynamic array is empty, the method returns Null.

Example

Sub UserProc;
Var
    ArrayL: IArrayList;
    Arr: Array Of Variant;
    i: Integer;
Begin
    ArrayL := New ArrayList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        ArrayL.Add(Math.RandBetweenI(0100));
    End For;
    Arr := ArrayL.ToArray;
End Sub UserProc;

After executing the example the Arr variable contains a one-dimensional array with random number of elements.

See also:

IArrayList