IList.Insert

Syntax

Insert(Index: Integer; Value: Variant);

Parameters

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

Value. Element value that should be added.

Description

The Insert method adds an element with the specified value to the specified position.

Example

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

After executing the example a dynamic array with random values is created, and one more element with the specified value is added to the first position.

See also:

IList