Run-Time Subroutine: Sorts a one-dimensional array. The array elements cannot be derived types or record structures.
Module: USE DFLIB
Syntax
Constant | Type of array |
---|---|
SRT$INTEGER1 | INTEGER(1) |
SRT$INTEGER2 | INTEGER(2) or equivalent |
SRT$INTEGER4 | INTEGER(4) or equivalent |
SRT$REAL4 | REAL(4) or equivalent |
SRT$REAL8 | REAL(8) or equivalent |
If the value provided in size is not a symbolic constant and is less than 32,767, the array is assumed to be a character array with size characters per element.
To be certain that SORTQQ is successful, compare the value returned in count to the value you provided. If they are the same, then SORTQQ sorted the correct number of elements.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
Example
! Sort a 1-D array
!
USE DFLIB
INTEGER(2) array(10)
INTEGER(2) i
DATA ARRAY /143, 99, 612, 61, 712, 9112, 6, 555, 2223, 67/
! Sort the array
Call SORTQQ (LOC(array), 10, SRT$INTEGER2)
! Display the sorted array
DO i = 1, 10
WRITE (*, 9000) i, array (i)
9000 FORMAT(1X, ' Array(',I2, '): ', I5)
END DO
END