The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: [1] function SortArray (Ascending: boolean; var Data: TDoubleArray; var Index: TIntArray): integer;
[2] function SortArray (Ascending: boolean; var Data: TIntArray; var Index: TIntArray): integer;

The method SortArray sorts the values of the array Data in an order which depends on parameter Ascending. The integer array Index returns the new sort order (assuming that the initial values are numbered from 1 to length(Data)) and is automatically resized to match the Data array.

The function returns the following error codes:

 0 .... everything OK
-1 ... the size of the Data array is less than 2

Last Update: 2020-Jan-29