This function to sorts records on any stack belonging to any IMOD. Up to six fields can be sorted on simultaneously, with the sorting precedence running from left to right.
SORT() can specify a stack external to an IMOD only when the target stack has been declared public for writing.
SORT([stack],[owner],[order,field,leng],...,[order,field,leng])
Parameters
Number of the stack to be referenced.
Default: If a local stack is referenced, the current stack (as set by the SWAPSTAK() function). Otherwise, the owning IMOD task sets the value using the PUBSTACK(DEFAULT) function.
IMOD ID of the owner of the stack (for external reference). This value can be obtained from the variable imod_id in the owning IMOD task. It is also the value that the SPAWN() function returns.
Default: Current IMOD task
Specify:
AP
An ascending sort; column number specifies the field.
DP
A descending sort; column number specifies the field.
Defines the start of a field. For column-specified fields (type = AP and DP), this is the column number of the start of the field.
Length of a sort field. For column-specified fields (type = AP and DP), this is the number of characters in the field.
ARG n MISSING OR INVALID
STACK NOT SPECIFIED AND NO DEFAULT
SPECIFIED STACK DOES NOT EXIST
SPECIFIED IMOD NOT FOUND
STACK WRITE FAILED
REQUESTED STACK DOES NOT EXIST
SPECIFIED IMOD/STACK NOT AUTHORIZED
Example
x = sort(0,2,'AP',7,10,'AP',1,6) /* Sort IMOD 2's stack 0. Sort the records by the 10-character field starting in column 7. Within equal records, sort on the 6-character field beginning in column 1. */
Copyright © 2014 CA Technologies.
All rights reserved.
|
|