IList.Add

Syntax

Add(Value: Variant): Integer;

Parameters

Value. Value that should be added.

Description

The Add method adds an element and returns its index.

Example

Sub UserProc;
Var
    ArrayL: IArrayList;
    i: Integer;
Begin
    ArrayL := 
New ArrayList.Create;
    
For i := 0 To Math.RandBetweenI(01000Do
        ArrayL.Add(Math.RandBetween(
0100));
    
End For;
    i := ArrayL.Count;
End Sub UserProc;

After executing the example a dynamic array with random values is created, and the "i" variable contains its size.

See also:

IList