Add(Value: Variant): Integer;
Value is a value that should be added.
The Add method adds an element and returns its index.
Sub Main;
Var
ArrayL: IArrayList;
List: IList;
i: Integer;
Begin
ArrayL:=New ArrayList.Create;
List:=ArrayL As IList;
For i:=0 To Math.RandBetweenI(0,1000) Do
List.Add(Math.RandBetween(0,100));
End For;
i:=List.Count;
End Sub Main;
After executing the example a dynamic array with random values is created, and the "i" variable contains its size.
See also: