ToArray: Array;
The ToArray method converts into standard array.
If the current dynamic array is empty, the method returns Null.
Sub UserProc;
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 UserProc;
After executing the example the Arr variable contains a one-dimensional array with random number of elements.
See also: