Insert(Index: Integer; Value: Variant);
Index - index of position where the element should be added.
Value - value of the element that should be added.
The Insert method adds an element with the Value value into the Index position.
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,100) Do
List.Add(Math.RandBetweenI(0,100));
End For;
List.Insert(0,"First");
End Sub Main;
After executing the example a dynamic array with random values is created, and one more element is added to the first position.
See also: