basic.sort Function/BASIC Program

basic.sort

Command basic.sort Function/BASIC Program
Applicable release versions: AP, AP 6.2
Category BASIC Program (486)
Description sorts a attribute or value mark delimited string.expression in ascending order.

If the expression contains both attribute and value marks, this function replaces all marks with the type first encountered.

On versions of AP 6.2.0 and above, a second sort function is available that works in a manner similar to the "locate" statement. On this expanded version, the user may specify in which attribute, and or value the list resides as well as the sort sequence to use.
Syntax sort(string.expression)
sort(string.expression, ac.expression, vc.expression, sequence.expression)
Options
Example
equ vm to char(253)
list='zebra':vm:'albatross':vm:'gooney 
bird':vm:'elephant'
newlist=sort(list)

The variable "newlist" contains the string:

albatross]elephant]gooney bird]zebra

The "]" (bracket) represents a value mark.
Purpose
Related basic.statements
ue.1072
basic.functions
basic.locate