GetRange(Index: Integer; Count: Integer): IArrayList;
Index. Element index, starting from which the range should be obtained.
Count. Number of array elements in the range that is to be obtained.
The GetRange method returns the array range according to the specified parameters.
Sub UserProc;
Var
ArrayL, ArrayL1: IArrayList;
i: Integer;
Begin
ArrayL := New ArrayList.Create;
ArrayL1 := New ArrayList.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
ArrayL.Add(Math.RandBetweenI(0, 100));
End For;
ArrayL1 := ArrayL.GetRange(10, ArrayL.Count - 20);
End Sub UserProc;
After executing the example the ArrayL dynamic array is created. The ArrayL1 array contains the copy of the ArrayL array except for first and last 10 elements.
See also: