IArrayList.GetRange

Syntax

GetRange(Index: Integer; Count: Integer): IArrayList;

Parameters

Index. Element index, starting from which the range should be obtained.

Count. Number of array elements in the range that is to be obtained.

Description

The GetRange method returns the array range according to the specified parameters.

Example

Sub UserProc;
Var
    ArrayL, ArrayL1: IArrayList;
    i: Integer;
Begin
    ArrayL := New ArrayList.Create;
    ArrayL1 := New ArrayList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        ArrayL.Add(Math.RandBetweenI(0100));
    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:

IArrayList