Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

create

create menu menuName
create stack fileName [with bkgnd ] ¬ [in a new window]

The create menu command makes a new menu and adds it to the menu bar. HyperCard displays an error message if you try to create a menu that already exists.

Use the put command to add menu items to the new menu. (Click Related Topics for more information about put.)

The create stack command creates a new stack from within a handler without presenting the New Stack dialog box. The cards in the new stack are the same size as the cards in the current stack.

HyperCard sets the function the result to "Couldn't create stack." if it can’t create the stack; otherwise, it sets the result to empty, goes to the new stack, and sends a newStack message to the only card in that stack (that is, the current card).


Demo Script

on createMenu
   if there is a menu "Sort" then delete menu "Sort"
   create menu "Sort"
   put "By name,By number,By International,-,Ascending,Descending" ¬
   into menu "Sort"
   set the checkMark of menuItem 1 of menu "Sort" to true
   set the checkMark of menuItem 5 of menu "Sort" to true
 end createMenu

Placeholders

menuName
A text expression that evaluates to the name of one of HyperCard’s menus or of a menu created by the user.

For example:

"File"
"Edit"
"Go"
"MyMenu"


fileName
An expression that evaluates to a text string that is also a valid Macintosh filename.

For example:

"my stack"
"HD20:Wally's Stacks:my stack"
"my file alias"


bkgnd
A HyperTalk expression that identifies a background by name, number, or id, using one of the following forms:

bkgnd id posInteger
bkgnd text -- name
bkgnd posInteger -- number
ordinal bkgnd
position bkgnd


For example:
bkgnd id 3894
bkgnd "Index"
bkgnd 1
prev bkgnd
previous bkgnd
next bkgnd
this bkgnd
first bkgnd
last bkgnd
middle bkgnd
any bkgnd
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

Related Topics

« copy template | HyperTalk Reference | debug »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

create

create menu menuName
create stack fileName [with bkgnd ] ¬ [in a new window]

The create menu command makes a new menu and adds it to the menu bar. HyperCard displays an error message if you try to create a menu that already exists.

Use the put command to add menu items to the new menu. (Click Related Topics for more information about put.)

The create stack command creates a new stack from within a handler without presenting the New Stack dialog box. The cards in the new stack are the same size as the cards in the current stack.

HyperCard sets the function the result to "Couldn't create stack." if it can’t create the stack; otherwise, it sets the result to empty, goes to the new stack, and sends a newStack message to the only card in that stack (that is, the current card).


Demo Script

on createMenu
   if there is a menu "Sort" then delete menu "Sort"
   create menu "Sort"
   put "By name,By number,By International,-,Ascending,Descending" ¬
   into menu "Sort"
   set the checkMark of menuItem 1 of menu "Sort" to true
   set the checkMark of menuItem 5 of menu "Sort" to true
 end createMenu

Placeholders

menuName
A text expression that evaluates to the name of one of HyperCard’s menus or of a menu created by the user.

For example:

"File"
"Edit"
"Go"
"MyMenu"


fileName
An expression that evaluates to a text string that is also a valid Macintosh filename.

For example:

"my stack"
"HD20:Wally's Stacks:my stack"
"my file alias"


bkgnd
A HyperTalk expression that identifies a background by name, number, or id, using one of the following forms:

bkgnd id posInteger
bkgnd text -- name
bkgnd posInteger -- number
ordinal bkgnd
position bkgnd


For example:
bkgnd id 3894
bkgnd "Index"
bkgnd 1
prev bkgnd
previous bkgnd
next bkgnd
this bkgnd
first bkgnd
last bkgnd
middle bkgnd
any bkgnd
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

Related Topics

« copy template | HyperTalk Reference | debug »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View