Compaq Fortran for Tru64 UNIX Alpha Systems V5.4
qsort (3f)
performs a quick sort of array elements
Syntax
dimension array(1)
integer*4 len, isize, compar ! compar can be integer*2
external qsort, compar
call qsort ( array, len, isize, compar )
Description
One dimensional array contains the elements to be sorted, while len is the
number of elements in the array. The isize argument is the size of an
element, normally as follows:
4 Integer and real
8 Double precision and complex
16 Double complex
(length of
character object) Character
The compar argument is the name of a user-supplied integer or integer*2
function that determines the sorting order. You must declare compar as
external (using an EXTERNAL statement) so it is recognized as a function.
This function is called with two arguments that are elements of array. The
function must return one of the following values:
negative If arg 1 is considered to precede arg 2
zero If arg 1 is equivalent to arg 2
positive If arg 1 is considered to follow arg 2
On return, the elements of array are sorted.
See Also
qsort(3)