IArrayList.AddRange

Syntax

AddRange(Collection: ICollection);

Parameters

Collection. Collection of elements that should be added to the array.

Description

The AddRange method adds the collection to the end of the array.

Example

Sub UserProc;
Var
    ArrayL, ArrayL1: IArrayList;
    i: Integer;
Begin
    ArrayL := New ArrayList.Create;
    ArrayL1 := New ArrayList.Create;
    For i := 0 To Math.RandBetweenI(0100Do
        ArrayL.Add(Math.RandBetweenI(0500));
    End For;
    For i := 0 To Math.RandBetweenI(0100Do
        ArrayL1.Add(Math.RandBetweenI(0500));
    End For;
    ArrayL.AddRange(ArrayL1 As ICollection);
End Sub UserProc;

After executing the example two dynamic arrays are generated, and the value of the second one is added to the end of the first one.

See also:

IArrayList