Clone: ISortedList;
The Clone method creates a copy of the array.
Sub UserProc;
Var
SortList, SortList1: ISortedList;
i: Integer;
Begin
SortList := New SortedList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
SortList.Add(Math.RandBetweenI(0, 100), "Number " + Math.RandBetweenI(0, 100).ToString);
End For;
SortList1 := SortList.Clone;
End Sub UserProc;
After executing the example the SortList1 array contains a copy of the SortList array.
See also: