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 array range, starting from element with the Index index.

Example

Sub Main;

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 Main;

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