Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
where chunks
are limited to either lines or items.
The first five forms of the sort
command order all the cards in a stack or background by the value of expression
, evaluated for each card in the stack or background.
The last form of the sort
command (by expression
) sorts lines or items of a container by any expression. If you don’t specify, sort
orders by lines. Before expression
is evaluated for each line or item of the container, the local variable each
is set to the contents of the chunk. (Click the Examples button to see syntax examples using each
.)
For all forms of the sort
command, the default sort direction is ascending,
and the default sort style is text
.
Sort direction ascending
orders the sort elements—the value of the expression on each card or the lines or items in the container—from lower to higher values.
Sort direction descending
orders the sort elements from higher to lower values.
Sort style text
compares the sort elements based on their ASCII values:
"1" < "101" < "2" < "a" < "ab" < "b"
Note that neither case nor diacritical marks matter with the sort style text
:
"apple" = "APPLE" = "äpplé"
Sort style numeric
correctly sorts numbers. With sort style text
,
"1" < "100" < "17" < "2"
The sort style numeric
correctly sorts these values as:
"1" < "2" < "17" < "100"
The sort style dateTime
orders the sort elements by their date or time format. (See the convert
command for valid date and time formats.)
The sort style international
correctly sorts non-English text containing diacritical marks and special characters based on the international resource installed in the current stack, the Home stack, HyperCard itself, or the System file.
One of the following:
One of the following:
HyperTalk Definition
Any HyperTalk expression. All expressions evaluate to text, a number, or a constant.
For example:
Note: Formally, HyperCard distinguishes between factors (simple values) and expressions. The difference between factors and expressions matters only if you like to drop parentheses. Most functions take factors as their parameters, which is why length of 3 + 5
returns 6
and length of (3 + 5)
returns 1
. In short, always use parentheses to group things the way you want them to evaluate, and you won’t have to worry about the difference between factors and expressions.
AppleScript Definition
Any series of words that has a value.
A HyperTalk expression that identifies a background by name, number, or id, using one of the following forms:
For example:
From within a background script, the term me
refers to that background.
When a background receives a the message [the] target
, that message is referring to the background.
See also: card
One of the following:
HyperTalk Definition
A place where you can store and retrieve a value.
There are six types of containers in HyperCard: a variable, a button, a field, the selection, the Message box, and menus.
Additionally, you can refer to a button or field by its part number:
AppleScript Definition
An object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of
or in
.
You can also use the possesive form ('s
) to specify containers. For example, in
the container is first window
. The object it contains is a name property.