Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (H-K)
Guardian Procedure Calls Reference Manual—522629-013
7-10
HEAPSORTX_ Procedure
If this parameter is specified, and not equal to 0D, the sort builds an array of
pointers in the area supplied by this parameter. It is these pointers that are
rearranged as the sort progresses. Only when the sort is complete is the actual
data supplied in the
array parameter rearranged. If this parameter is omitted or
specified as 0D, the sort works directly on the data supplied in the
array
parameter. Supplying this parameter can substantially improve the performance of
the sort, especially if there is a large number of elements or a large element size.
Considerations
•
In addition to its local variables, HEAPSORTX_ allocates stack space equal to the
value you specify as the size of one array element. If insufficient stack space is
available, HEAPSORTX_ returns an error 632.
Example
In the following example, HEAPSORTX_ sorts the elements in ARRAY in ascending
order.
CALL HEAPSORTX_ ( array, num^elements, element^size,
ascending );
Related Programming Manual
For programming information about the HEAPSORTX_ procedure, refer to the
Guardian Programmer’s Guide.