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.

wait

wait [for] posInteger [ticks] wait [for] posInteger seconds wait until trueOrFalse wait while trueOrFalse The wait command causes HyperCard to pause before executing the rest of a handler, either for a specific length of time, until a specified condition becomes true, or while a specified condition remains true.

If you do not specify seconds as the unit of time, HyperCard uses ticks. (One tick equals one-sixtieth of a second.)


Examples

wait 7
wait for 7
wait 7 ticks
wait for 7 ticks

wait for 1 second
wait 3 seconds

wait until the mouse is up
wait until the mouseLoc is within the rect of button 1
wait until the sound is done
wait while the commandKey is down
wait while the mouseLoc is within the rect of button 1
wait until the mouseClick

Demo Script

on waitUntilTheMouse
   set the cursor to arrow
   show bkgnd field "demo field"
   displayMessage "Click the mouse to continue . . ."
   wait until the mouseClick
   hide bkgnd field "demo field"
 end waitUntilTheMouse

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

trueOrFalse
Any expression that evaluates to the HyperTalk and AppleScript constants true or false.

For example:

true
false
the hilite of bg btn "Yes"
fld "Zip" contains "95014"
the short name of this stack is "Fred"


Related Topics

« visual | HyperTalk Reference | write »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View