IArrayList.InsertRange

Syntax

InsertRange(Index: Integer; Collection: ICollection);

Parameters

Index. Index of the position, to which the collection should be added to.

Collection. Elements collection that should be added to the array.

Description

The InsertRange method inserts the elements collection into the specified position.

Example

Sub UserProc;
Var
    ArrayL, ArrayL1: IArrayList;
    i: Integer;
Begin
    ArrayL := New ArrayList.Create;
    ArrayL1 := New ArrayList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        ArrayL.Add(Math.RandBetweenI(0100));
    End For;
    For i := 0 To Math.RandBetweenI(50100Do
        ArrayL1.Add(Math.RandBetweenI(0100));
    End For;
    ArrayL.InsertRange(Double.FloorInt(ArrayL.Count / 2), ArrayL1 As ICollection);
End Sub UserProc;

After executing the example two dynamic arrays are generated, and values of the second one are added to the middle of the first one.

See also:

IArrayList