qsort(3f)

Name
qsort - performs a quick sort of array elements

Syntax
dimension array(len)
integer len, isize, compare
external qsort, compare
call qsort ( array, len, isize, compare )

Description
The 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 compare argument is the name of a user-supplied integer function that determines the sorting order. You must declare compare 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.

Files
libU77.a

See Also
qsort(3)