IStringList.SortRange

Syntax

SortRange(Index: Integer; Count: Integer);

Parameters

Index. Index of the element, from which the range starts.

Count. Number of range elements.

Description

The SortRange method sorts the array range in ascending order.

Example

Sub UserProc;
Var
    StrL: IStringList;
    i: Integer;
Begin
    StrL := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL.Add("Number " + Math.RandBetweenI(0100).ToString);
    End For;
    StrL.SortRange(10, StrL.Count - 20);
End Sub UserProc;

After executing the example a dynamic array of strings is generated, and the midsection of array, except for the first and last 10 elements, is sorted in ascending order.

See also:

IStringList