basic.sort

Function/BASIC Program, Releases: AP and AP 6.2

Sorts a string of attributes or values.

Syntax

sort(string.expression) sort(string.expression, ac.expression, vc.expression, sequence.expression)

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.

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.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
ue.1072 User Exit Sorts a dynamic array.
basic.functions Definition elements in FlashBASIC or Pick/BASIC language expressions, returning a single value in place, as a function of the arguments. A function can be used anywhere a variable or expression is used.
basic.locate Statement Locates element in string expression.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.