The SORT_LIST command is used to sort a list into a nominated sequence.
The list specified must be a working list (used to store information within a program). It is not possible to use the SORT_LIST command against a browse list (used for displaying information at a workstation).
Sorting a Static Working List or a Dynamic Working List with all its entries in a single block of memory is accomplished by sorting the entries in place.
When a Dynamic Working List has its entries across multiple blocks of memory, Visual LANSA performs the sort by allocating a single block of memory; filling the block with pointers that address each entry in the working list and then sorting the block of pointers.
While this technique enables the SORT_LIST command to work with Dynamic Working Lists managing multiple blocks of memory, the SORT_LIST command has a limitation – it must allocate a single block of memory that can contain a pointer to each entry in the working list:
Refer to the 7.26 DEF_LIST command for further information of lists and list processing.
SORT_LIST ---- NAMED -------- *FIRST ------------------------->
name of list
BY_FIELDS ---- name of field --- *ASCEND ------|
| *DESCEND |
| expandable group expression |
-------- 100 maximum --------