Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
The put
command evaluates an expression and places the value it extracts into
, after
, or before
the contents of a container.
The container can be a button, a field, a variable, the Message box, the selection, a chunk
expression, or a menu. If you don’t specify a container, HyperCard puts the value into the Message box, showing it if it’s hidden.
Use put
with into
to replace the contents of a container or menu, with before
to place the value at the beginning of its contents, and with after
to append the value to the end of its contents.
The lines of text that you put into a pop-up button become the items of the menu that appears when you click the button.
Before you can add items to a menu, the menu must already exist.
The menuItemList
is a comma-separated list of the items you want to add to the menu. Use the single character "-"
to get a gray line. You can put up to 64 items into a menu with a single put
statement.
The optional messageList
is a comma-separated list of message names that HyperCard sends to the current card when the user chooses one of the menu items. The number of items in the messageList
must equal the number of items in menuItemList.
To skip a message name, use an empty item—a null between two commas:
"myMessage 1,,myMessage 3"
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.
One of the following:
One of the following forms (or combinations thereof):
For example:
A chunk combined with of
and a container is called a chunk expression. For example: line 1 of card field "index"
Important: You can’t combine a stack name with a chunk expression—you can only refer to a chunk in the current stack.
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.
A comma-separated list of names that you want to appear on a menu.
Use the single character “-
” to get a gray line.
For example, the Menu item list for the first 9 items on the Go menu would be:
See also: messageList
.
An expression that evaluates to one of the following:
For example:
An expression that evaluates to one of the following:
For example:
A comma-separated list of message names that you want sent when the user chooses a menu item in menuItemList
.
Use empty
to indicate no message in HyperTalk, or ""
to indicate no message in AppleScript.
For example, the menu message list for the first 9 items on the Go menu would be: