AddRange(Collection: ICollection);
Collection. Collection of elements that should be added to the array.
The AddRange method adds the specified collection of element to the end of array.
Sub UserProc;
Var
StrL1, StrL2: IStringList;
i: Integer;
Begin
StrL1 := New StringList.Create;
StrL2 := New StringList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrL1.Add("Value " + Math.RandBetweenI(0, 100).ToString);
End For;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrL2.Add("Value " + Math.RandBetweenI(100, 200).ToString);
End For;
StrL1.AddRange(StrL2);
End Sub UserProc;
On executing the example two dynamic arrays of strings are generated. Values of the second array will be added to the end of the first one.
See also: