TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-368
#SORT Built-In Function
#SORT Built-In Function
Use #SORT to sort a space-separated list of text.
option
specifies the order in which the indicated text is to be sorted. If you omit option,
ascending order is the default. If, however, there is any chance that the text may
begin with a slash (/), you must include an option so that the slash in the text is not
interpreted as the beginning of the option. option is one of these:
ASCENDING
specifies that the text is to be sorted in ascending order according to the ASCII
collating sequence.
DESCENDING
specifies that the text is to be sorted in descending order according to the
ASCII collating sequence.
text
specifies a space-separated list to be sorted. If not specified, #SORT does nothing.
Result
#SORT returns a sorted space-separated list.
Considerations
•
#SORT upshifts all characters before comparing them, so uppercase and
lowercase forms of the same character sort as equal; equal characters do not
change position with regard to each other during sorting.
•
When dealing with characters from the upper half of the international character set,
the character-processing rules in effect have an influence on #SORT (see
Examples
).
Examples
1. This example illustrates the use of #SORT on a specified list of characters:
65> [#DEF pogo TEXT |BODY| albert howland churchy
grundoon]
66> #OUTPUT [#SORT /DESCENDING/ [pogo]]
albert churchy grundon howland
#SORT [ / option / ] [ text ]