ToArray: Array;
The ToArray method converts into standard array.
If array is empty, the ToArray method returns Null.
Sub Main;
Var
ArrayL: IArrayList;
Arr: Array Of Variant;
i: Integer;
Begin
ArrayL:=New ArrayList.Create;
For i:=0 To Math.RandBetweenI(50,100) Do
ArrayL.Add(Math.RandBetweenI(0,100));
End For;
Arr:=ArrayL.ToArray;
End Sub Main;
After executing the example the Arr variable contains a one-dimensional array with random number of elements.
See also: