Error getting tags :
error 404Error getting tags :
error 404 sort | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
sort
Basics
Expander triangle
Type
Command
Syntax
sort [marked] cards [of stack] [direction] [sortType] by sortKey
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Sorts the cards of a stack into a new order.
Examples

sort cards by field "Name"
sort cards of this stack by random(the number of cards)
sort marked cards of stack "Next" numeric by the number of buttons
sort cards numeric by the short ID of this card
sort cards of stack "Manson" descending dateTime by item 1 of field "Date"

Additional Comments
Expander triangle

Use the sort command to shuffle the cards in a stack into a new order, or to shuffle a subset of the cards in a stack.

Parameters:

The stack is a reference to any open stack. If you don't specify a stack, the cards of the current stack are sorted.

The direction is either ascending or descending. If you don't specify a direction, the sort is ascending.

The sortType is one of text, international, numeric, or dateTime. If you don't specify a sortType, the sort is by text.

The sortKey is an expression that evaluates to a value for each card in the stack. Any object references within the sortKey are treated as pertaining to each card being evaluated, so for example, a reference to a field is evaluated according to that field's contents on each card.

Comments:

The sort text form sorts by the ASCII value of each character.

The sort international form is like sort text, except that it sorts accented characters together with their unaccented counterparts. For example, "é" sorts between "e" and "f", rather than at the end of the alphabet as it would using the sort text form.

The sort numeric form sorts by number. (Use this form if the sortKey consists of numbers.)

The sort dateTime form treats the sortKey as a date and/or time.

The sort command is a stable sort. This means that if the sortKey for two cards is the same, sorting does not change their order, so you can do two successive sorts to create subcategories within the major sort categories. For example, to sort the cards of a stack by ZIP code and sort within each ZIP code by last names, use these two statements:

sort cards by field "Last Name"

sort cards numeric by field "ZIP code"

User Comments
Expander triangle
User thumbnail
Craig Newman (dunbarx)
StarStarStarStarStar
Jan 21, 2011
Multiple stable sorts may be implemented directly by concatenating sortKeys:
sort container by sortKey1 & sortKey2 & sortKey3...
Sortkey order determines the sorting sequence