Home
The HyperCard Center
HyperTalk Reference

Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.

push

push card
push card [of stack]
push bkgnd [of stack]
push stack

The push command saves the identification of a card in HyperCard’s memory. If you specify a background or stack, HyperCard stores the location of the first card of the background or stack. In all cases, HyperCard saves the full card ID and the path name for the stack.

Each call to push saves a card ID in last-in, first-out order. You can return to saved locations using the pop command.

Note: The word stack that forms part of the stack identifier stack is optional with the push command.

There is a limit of twenty pushes.

If you pop more than you push, you go to the Home stack.

Examples

push card
push this card
push next card
push recent card -- remember where you've been
push card 234 of this stack
push first card of stack "Home"
push first card of "Home"
push background "Index" of stack "Glossary"
push background "Index" of "Glossary"
push stack "Home"
push "Home"

Demo Script

on goHomeAndBack
-- This demo shows that you can push and pop more than one card. Each
-- successive pop goes back through the pushed cards.
click at the loc of bkgnd button "close"
set lockMessages to true
push this card
go prev card
push this card
wait 1 second
go to card 3 of stack "Home"
wait 1 second
pop card
pop card
click at the loc of bkgnd button "Demo Script"
end goHomeAndBack

Related Topics

Placeholders

card

An expression that identifies a card by name, number, or id using one of the following forms (in AppleScript, use “background” in place of “bkgnd”):

recent card
back
forth
card id posInteger [of bkgnd
card text [of bkgnd] -- name
card posInteger [of bkgnd] -- number
ordinal card [of bkgnd]
position card [of bkgnd]
ordinal marked card
position marked card
marked card posInteger

For example:

card id 3894
card "Index"
card 1 of background 1
prev card
previous card of this background
next card
this card
first card
last card
middle card
any card
first marked card
last marked card
next marked card
previous marked card
marked card 1
marked card (the number of marked cards)

When used inside a card script in HyperTalk: me

When a card receives a message: [the] target

See also: button and field

stack

An expression that identifies a stack by its name, using one of the following forms:

this stack
stack text -- name or path name

For example:

stack "Home"
stack "Simonides:School:References"
this stack
stack "HD:Stacks:Addresses alias

When used inside a stack script: me

When a stack receives a message: [the] target

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

HyperTalk Reference

Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Retro View