IList.Add

Syntax

Add(Value: Variant): Integer;

Parameters

Value is a value that should be added.

Description

The Add method adds an element and returns its index.

Example

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:

IList