8L xC)pJJJJ IH(ȱH:=IH[H`@H^H 2 9 @   I/H`JLNGȄBȄF aK ' faaFF  RJm# KKJ qJ )J ۈJJm  JFȱJGJKaȄM ' 5aaNNJFLGJ`a  XL LG &PRODOS`DaElH$?EGvѶK+`L XX LU ŠϠĠӥS)*+,+`F)) (*=GJFjJJA QE'+ '== `@ STSP8QSS8 m P o R(8RHYPERTALKHELPs&ܽs"' @]HYPERTALKHELPUܽs \MEDIACONTROLUr! s XWHATSNEWU.s8  ICONSh s&FINDER.DATAjs&ps& dm6(STAKM+a(= > z.Ps Ps ```n HyperTalkHelppUpdospUpdos6 No1 No2 LeftArrow RgtArrow Tips SeeAlso Print CardHelp ExitHelp BackTo1 GoBack Examples Topics Search AboutHelp :p1D  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~DDDDDDDDDDDDDDDDDDPPPUPUPPPUPUdFDffDFdFdfDDfdFdFDffDFdFdfDDfdFODDOwwwwwwwwaaaaaaaaaaaaaaaaOOOOOOOOOOOOOOOOuuuuWWWWuuuuWWWWuuuuWWWWuuuuWWWWoooooooooooooooo----------------- Script info for this Stack----------------- -- 1990, 1991 by Apple Computer, Inc. -- All Rights Reserved HANDLERS: openStack topicListNav doMenu closeMe arrowkey -- closeStack Size of script: 5706 chars. ----------------------------------------------------------- on openStack global OpenFieldName,RecentStack,SaveUserLevel,Keywd global FindKeyword,CurrentCard,FoundList,KeywdList -- Make sure we are running version 1.1 or later if the version < 1.1 then set lockMessages to true answer "This stack requires HyperCard IIGS version 1.1 or" && "later." with "Home" go home exit to hyperCard end if push recent cd pop cd into recentCard if "help" is not in recentCard then put recentCard into RecentStack put the userLevel into SaveUserLevel set userModify to true set cantModify of this stack to true put empty into Keywd put empty into KeywdList put "date" into FindKeyword put empty into FoundList put empty into CurrentCard put empty into OpenFieldName show menubar hide msg box pass openStack end openStack on topicListNav -- This handler gets the name of the selection clicked -- and goes to the corresponding card. global OpenFieldName set the cursor to 4 do "put" && the clickLine && "into theLine" --put line (round(scroll of the target + (((the clickV - top of the --target) div textHeight of the target) + 1))) of target into theLine if theLine is empty then if id of this bg = 3914 then closeMe put empty into goHere else put return after theLine get offset(theLine,target) select char it to (the length of theLine + it - 1) of the target put "c" & char 1 to 28 of the selection into goHere repeat until last char of goHere is not space and last char of goHere is not return delete last char of goHere end repeat lock screen go cd goHere unlock screen with iris open end if wait while the mouseClick -- Gets rid of additional mouse clicks. end topicListNav on doMenu what -- Traps menu choices and makes them react in a defined way. global FindKeyword,CurrentCard,FoundList if what is "Prev" then lock screen go prev cd unlock screen with wipe right else if what is "Next" then lock screen go next cd unlock screen with wipe left else if what is "Last" then lock screen go last cd unlock screen with visual wipe left else if what is "First" then lock screen go first cd unlock screen with visual wipe right else if what is "Back" then lock screen go back unlock screen with iris close else if what is "Background" then set cursor to 4 if the editBkgnd is true then lock screen set the editBkgnd to false send openCard to this card unlock screen else set the editBkgnd to true else if what is "Find..." then ask "Enter the word(s) you wish to find: " with FindKeyword put it into FindKeyword set cursor to busy lock screen find FindKeyword if the result is not empty then unlock screen with iris open answer "The word(s) " & quote & FindKeyword & quote & " were not found. Please try another word or phrase." else put the ticks into startTime repeat until the foundChunk is not in FoundList or the ticks > startTime + 60 find FindKeyword end repeat if the short name of this card is not CurrentCard then put empty into FoundList put the short name of this card into CurrentCard end if put the foundChunk & return after FoundList put the short name of the foundField into fldName if fldName is "Tips" or fldName is "Examples" and the visible of bg fld fldName is false then send mouseUp to bg btn (fldName && "toggle") end if click at 0,0 repeat (number of lines of FoundList - 1) find FindKeyword end repeat unlock screen with iris open find FindKeyword end if else if what is "Protect Stack..." then answer "HyperCard IIGS Help is a protected stack. It has been" & " locked to make sure that it works properly. Unlocking this " & "stack may cause it to malfunction." with "Continue" or "Cancel" if it is "Continue" then pass doMenu end if else pass doMenu end doMenu on closeMe -- Hides the Tips, Examples, and See Also bg flds and btns. set cursor to 4 lock screen if number of cd btns > 0 then repeat with i = 1 to number of cd btns show cd btn i end repeat end if show cd pict if the short id of this cd = 8901 then show cd fld 1 show cd fld 2 end if hide bg btn "examples" hide bg fld "examples" hide bg btn "tips" hide bg fld "tips" hide bg btn "see also (click an item.)" hide bg fld "see also" unlock screen with dissolve fast wait while the mouseClick -- Gets rid of additional mouse clicks. end closeMe on arrowkey direction -- Traps for arrowkeys and makes them react in a defined way. -- Sets the Up and Down arrow to do nothing to prevent confusion -- to the novice in navigating through the stack. if direction is "left" then lock screen go prev cd unlock screen with wipe right else if direction is "right" then lock screen go next cd unlock screen with wipe left end if end arrowkey on closeStack -- Put empty into the globals to release memory. global FieldOpen,Keywd,OpenFieldName,SaveUserLevel set the userLevel to SaveUserLevel put empty into FieldOpen put empty into Keywd put empty into OpenFieldName pass closeStack end closeStack o SaveUserLevel put empty into FieldOpen put empty into Keywd put empty into OpenFieldName pass closeStack end closeStack ev cd then set the name of this card to "c" & char 1 to 28 of bg fld "subtopic" else set the name of this card to "" end repeat go cd 1 GetCardNames end RenameCards on GetCardNames repeat with i = 1 to number of cards put i & " - " & the short name of this card & return after CardNames go next cd end repeat go cd 1 put CardNames into cd fld "CardNames" end GetCardNames es repeat with i = 1 to number of cards put i & " - " & the short name of this card & return after CardNames go next cd end repeat go cd 1 put CardNames into cd fld "CardNames" end GetCardNames 3094 else set the icon of bg btn "Examples Toggle" to 3093 if bg fld "See Also" is empty then set the icon of bg btn "See Also Toggle" to 3012 else set the icon of bg btn "See Also Toggle" to 3011 unlock screen with wipe left fast end if end if end goNextTool on closeStack global FieldOpen,HotCard,LineNo,OpenFieldName,Red,SaveUserLevel lock screen push cd go cd 1 if OpenFieldName is not empty then hide cd fld OpenFieldName set hilite of cd btn OpenFieldName to false end if hide cd fld "subtopic 1" hide bg btn "No2" pop cd unlock screen visual effect iris close set the userLevel to SaveUserLevel put empty into FieldOpen put empty into HotCard put empty into LineNo put empty into OpenFieldName put empty into Red --put empty into SaveUserLevel pass closeStack end closeStack -- THESE ARE DEBUG TOOLS TO BE DELETED IN FINAL BUILD on MoveText global BgText1,BgText2,BgText3,BgText4,BgText5 global BgText6,BgText7,BgText8,BgText9,BgText10 set cursor to 4 set lockmessages to true repeat with i = 2 to (number of cards -1) push cd -- CHANGE STACK NAME TO CURRENT STACK HAVING TEXT CHANGES go cd i of stack "TalkHelp.a0504j" put bg fld 1 into BgText1 put bg fld 2 into BgText2 put bg fld 3 into BgText3 put bg fld 4 into BgText4 put bg fld 5 into BgText5 put bg fld 6 into BgText6 put bg fld 7 into BgText7 put bg fld 8 into BgText8 put bg fld 9 into BgText9 put bg fld 10 into BgText10 pop cd put BgText1 into bg fld 1 of cd i put BgText2 into bg fld 2 of cd i put BgText3 into bg fld 3 of cd i put BgText4 into bg fld 4 of cd i put BgText5 into bg fld 5 of cd i put BgText6 into bg fld 6 of cd i put BgText7 into bg fld 7 of cd i put BgText8 into bg fld 8 of cd i put BgText9 into bg fld 9 of cd i put BgText10 into bg fld 10 of cd i end repeat RenameCards end MoveText on RenameCards go cd 2 repeat until last char of bg fld "subTopic" is not space AND last char of bg fld "subTopic" is not return delete last char of bg fld "subTopic" end repeat set the name of this card to "c" & char 1 to 28 of bg fld "subtopic" repeat with i = 3 to number of cards-1 go cd i repeat until last char of bg fld "subTopic" is not space AND last char of bg fld "subTopic" is not return delete last char of bg fld "subTopic" end repeat if bg fld "subtopic" bg fld "subtopic" of prev cd then set the name of this card to "c" & char 1 to 28 of bg fld "subtopic" else set the name of this card to "" end repeat go cd 1 GetCardNames end RenameCards on GetCardNames repeat with i = 1 to number of cards put i & " - " & the short name of this card & return after CardNames go next cd end repeat go cd 1 put CardNames into cd fld "CardNames" end GetCardNames es dNames cd fld "CardNames" end GetCardNames d GetCardNames MAST! =Dh { J) (5ME_gXH} O/ ` ε%H` Q !b BiŔI  %% -# azhXGk) w B %4  F. Y; F R \  o  + = M t q p D :  ( 4 XA J X h r   } ` g ;N & B?\t'=')D}Bt[s` F3D-B\=2Ň1Ab"E1UZyΡ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a@< U ! `i@  A@Gq4H "PAGE.fb>@@/GHZHN[20A:@>30EA@#(R&'cf$H6pD!ɞ 9d`ȤJX9&DA= AcJ8$df% T5& D`)B1`~ F?aMCq)D44j!# $.e 4E  pHq !0@ lB;$9$i@. F=gD(@e"U Qe iIbB0! nB7@hq2)6$F2iD@tE pu `IF@ ! 7@Ha2$!.Є2jYF5#E p',`j@P%4=# ,vEr4.h gۂ2ȪD dQ aKP!<7TڕW TF퐇?ňJFA "f0p ߐ#  fU 1[P,<3TN퐄?ʼnJGA$"vU0pǘ# C Qz =Q_xMSGiIT5PY5=Gs{);֜B'l&Dh@@ &0 CB%P" .mb=UtROD5StPI8PO,KZAkYF g2.Jo(*.$Ζ>V|`T-["OۿUxe͑*-oA >Nݽ? V?n ;HD%Qʐ@"B&Ё DPADp& P@@**N UoDD$ P B( 00TQ P % @` *R@-Z @&@Te@5Z 12PRF HCA$&q"F`* QĈq "@PTP&` QaE 05X@-H@"2@H(7HGsrY<}5AQ*OxxbeÐo>]cS2UQtrl%@Pb `B,D"$4 U#A"04 .UuR&lB5@ @L"$0D 2SȂ ,a %vR$l 5@ `@"ZDJ"S ,@wR4h %P"h(CmE L "$C(B01$@4x2LOD@PfIszif A2;H/ 'ћ`0.ф ҫ jyv [t~  QQmqKB*c&=ILψ\.cMHA(64 *[v{fqyz at?pHzn] Us]qԼ?꯷ed|@BzqyJHbH'CXH`2(1$ K,\$ }@0!`H `HBh!H@ @@   (,BKGD= Jr. ?  Exiton mouseUp global RecentStack set cursor to 4 go RecentStack wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUpBx  hypercardon MouseUp set cursor to 4 wait while the mouseClick -- Gets rid of additional mouse clicks. visual zoom out go stack "Help" end MouseUp>&'3^ topics head 8*4 topics 4+$o6  No24,$6  No1-|  Searchon mouseUp set cursor to 4 lock screen go cd id 11393 unlock screen with iris open select text in cd fld "Look Up Keys" wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp., About this stackon mouseUp if visible of cd fld "about" then hide cd fld "about" else show cd fld "about" end mouseUpPs Ps First Card BG BMAP . 0 0 000"  000 3330 333# 3330333 3330?333 3330?333 3330?<?< ?<333 3330333 3330 ?333 3330<333 3330!333 3330?<?< <333(̡ 33303 3333333  33303 3333. 33308(33333?? 0???0???? ??33? 0???(00 <<<<?0/0    33308? ́ 133333 333000000<3#33333 333000   ! 0 033333<<0  @  3330 333338333< (800<330  @000<<<< 30333  0 D 3330  3033 Á133333 3033  33300000 330330 03333300<< 333033300<   3330  3303330 33333  30330030 ́  3330 030 330 0133333 30330<  333000(0  033 3 033333 3330 ( 300?? 03333330 33 ? ́) 33300000 0 ́(333330<0<< <33?0 ́ 3330 ) 330 ́133333 33308330 333333300<0"3038<0<<<< !33 8 < 3030<8 333033001?3 3333 3303 080 <0<<#30330 <0<< < )3030 3330 Á 030333330300"30300<<0<<30<3 3330  03 8133333 3330!03333303?00<30̅ 3330 0 0 0333333 <0< 338330383033 3330000 0 00330033333<0<< <<330 < 3300 33 3 3330000003330333330<<0<<3330<0 << 33 03̃  33300 333330<0 <<<0 <03 3330 (  133333 3330(33333 3330)00333330<<<<0 << 3330 0 Â 3333300<<0  3330 0   133333< ς? 3330033333 0? 3330* 0 0 ??33333 3330 0   33333< ρ ?!? 33300 03 3333<( 0<#?0(<<  (Á 3330000133333 3330 0 0?33333 0<?<<  333000?333330( 333080 0(33333?<<1 33300033333 33308(33333 3330)?<033333 33300< 33333 3330133333 3330? 33333 3330 333330 ???<  0??<<<<?<<< 0 then repeat with i = 1 to number of cd btns if item 1 of the loc of cd btn i < 160 then hide cd btn i end repeat end if hide cd pict if the short id of this cd = 8901 then hide cd fld 1 hide cd fld 2 end if set visible of bg btn "tips" to true set visible of bg fld "tips" to true hide bg btn "see also (click an item.)" hide bg fld "see also" hide bg btn "examples" hide bg fld "examples" put "tips" into FieldOpen set the scroll of bg fld "tips" to 0 unlock screen with dissolve fast else if number of cd btns > 0 then repeat with i = 1 to number of cd btns show cd btn i end repeat end if show cd pict if the short id of this cd = 8901 then show cd fld 1 show cd fld 2 end if set visible of bg btn "tips" to false set visible of bg fld "tips" to false unlock screen with dissolve fast end if wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp3{  See Also Toggleon mouseUp global FieldOpen set cursor to 4 lock screen if visible of bg fld "see also" is false then if number of cd btns > 0 then repeat with i = 1 to number of cd btns if item 1 of the loc of cd btn i < 160 then hide cd btn i end repeat end if set visible of bg btn "see also (click an item.)" to true set visible of bg fld "see also" to true hide bg btn "tips" hide bg fld "tips" hide bg btn "examples" hide bg fld "examples" put "see" into FieldOpen set the scroll of bg fld "see also" to 0 unlock screen with dissolve fast else if number of cd btns > 0 then repeat with i = 1 to number of cd btns show cd btn i end repeat end if set visible of bg btn "see also (click an item.)" to false set visible of bg fld "see also" to false unlock screen with dissolve fast end if wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp nD) 6 See Also (Click an item.)on mouseDown closeMe end mouseDown FBx  hypercardon MouseUp set cursor to 4 wait while the mouseClick -- Gets rid of additional mouse clicks. visual effect zoom out go to stack "Help" end MouseUpG ?  Exiton mouseUp global RecentStack set cursor to 4 go RecentStack wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUpH  Printon mouseUp set cursor to 4 if visible of bg fld "Tips" or visible of bg fld "Examples" or visible of bg fld "See Also" then put "Tips: " & bg fld 1 & return & return into printTips put bg fld "Tips" & return & return & return after printTips put "Examples: " & bg fld 1 & return & return after printTips put bg fld "Examples" & return & return & return after printTips put "See Also: " & bg fld 1 & return & return after printTips put bg fld "See Also" & return after printTips print printTips exit mouseUp else set printTemplate to "Print Talk Text" push cd put word 1 of bg fld "cardofcards" into start put word 3 of bg fld "cardofcards" into endPrt if start "1 " then put (number of this cd) - (start - 1) into start go cd start end if open printing print this card repeat with count = 1 to endPrt-1 go next cd print this card end repeat close printing pop cd wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp XJ) 6 Tipson mouseDown closeMe end mouseDown > $ cardOfCards <L  backto1on mouseUp set cursor to 4 put word 1 of bg fld "cardofcards" into start put (number of this cd) - (start - 1) into start lock screen go cd start unlock screen with wipe right fast wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp OBy   Examples toggleon mouseUp global FieldOpen set cursor to 4 lock screen if visible of bg fld "Examples" is false then if number of cd btns > 0 then repeat with i = 1 to number of cd btns if item 1 of the loc of cd btn i < 160 then hide cd btn i end repeat end if set the visible of bg btn "examples" to true set visible of bg fld "examples" to true hide bg btn "tips" hide bg fld "tips" hide bg btn "see also (click an item.)" hide bg fld "see also" put "examples" into FieldOpen set the scroll of bg fld "examples" to 0 unlock screen with dissolve fast else if number of cd btns > 0 then repeat with i = 1 to number of cd btns show cd btn i end repeat end if set the visible of bg btn "examples" to false set visible of bg fld "examples" to false unlock screen with dissolve fast end if wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUp ^Q6 0 exampleson mouseDown closeMe end mouseDown \W) 6 Exampleson mouseDown closeMe end mouseDown Z|  Searchon mouseUp set cursor to 4 lock screen go cd id 11393 unlock screen with iris open select text in cd fld "Look Up Keys" wait while the mouseClick -- Gets rid of additional mouse clicks. end mouseUpITipsPs Ps Task card BGon openCard -- Shows the appropriate buttons on the card being viewed. put word 1 of bg fld "cardofcards" into start if start 1 then show bg btn "backto1" if number of this cd < number of cards-1 then if (char 1 to 3 of bg fld "topic" = char 1 to 3 of bg fld "topic" of next cd) then show bg btn "next arrow" end if if number of this cd 2 then if (char 1 to 3 of bg fld "topic" = char 1 to 3 of bg fld "topic" of prev cd) then show bg btn "prev arrow" end if if bg fld "Tips" is not empty then show bg btn "Tips Toggle" if bg fld "Examples" is not empty then show bg btn "Examples Toggle" if bg fld "See Also" is not empty then show bg btn "See Also Toggle" end openCardBMAPx- 0 0  0< 000 3330 333,̡ 3330 3333 3330  33303 3333OO= 33303303333333 ( 330000 ( ( 0000000003 00333303333?3303 " 0033300033333  0 0 003000 33333033330)3́? 0 33 30030033300333033333!Á03 0 Á<0 0  33300)33300333 3330́3 00 ?<03 ́330 30133333 0< ́ 303330033303333)00 33 ??0 3 3003303303330338?33 0 000 300033303303303330  330333#30030033333 ̡ 8 ̢ ̡(33003 30330 3( ( 00033 3330333333333 0 <0< 0000.HP ?BKGDrX2= Jv:$  KeyTable<$. TopicTablePs Ps @BMAPX2 - 0 0  0< 000 3330 333,̡ 3330 3333 3330  33303 3333OOL 0 <0< 0000.30000 CARD zz0= $Ab6B  hypertalk basicson mouseUp showTopic end mouseUp bBN  system messageson mouseUp showTopic end mouseUp dLX  control structureson mouseUp showTopic end mouseUp ZWc  commandson mouseUp showTopic end mouseUp \my  propertieson mouseUp showTopic end mouseUp \x  operatorson mouseUp showTopic end mouseUp \4bn  functionson mouseUp showTopic end mouseUp h:5. hypertalk basicson mouseDown topicListNav end mouseDownb;5. commandson mouseDown topicListNav end mouseDown b<5. functionson mouseDown topicListNav end mouseDown b>5. operatorson mouseDown topicListNav end mouseDown l?5. control structureson mouseDown topicListNav end mouseDown d@5. propertieson mouseDown topicListNav end mouseDown hA5. system messageson mouseDown topicListNav end mouseDown 8l#7 topic <o'3 subtopic 1 Tu8+8 abouton mouseUp hide me end mouseUp-+Using HyperTalk Help What is HyperTalk? Messages and Objects The message-passing order Message handlers Handlers within handlers Function handlers Getting values Using variables Referring to objects Looking at scripts Writing your own handlers Debugging scripts Synonyms and abbreviations What is a command? add answer arrowKey (command) ask beep choose click close file close printing controlKey (command) convert create stack delete delete stack dial divide doMenu (command) drag edit script enterKey (command) export paint find functionKey (command) get go help (command) hide (command) import paint lock printTemplate lock screen multiply open open file open printing play pop card print print card push put read reset paint returnKey (command) save select set show (command) show cards sort subtract tabKey (command) type unlock printTemplate unlock screen visual wait write What is a function? abs annuity atan average charToNum clickChunk clickLine clickLoc commandKey compound cos date diskSpace exp exp1 exp2 foundChunk foundField foundLine foundText hilitedBtn length ln, ln1, log2 max min mouse mouseClick mouseH, mouseV mouseLoc number numToChar offset optionKey param paramCount params random result round screenRect seconds selectedChunk selectedField selectedLine selectedText shiftKey sin sound sqrt tan target ticks time tool trunc value Arithmetic operators Comparison operators Logical operators Text operators Operator precedence Table of constants What is a control structure? do end exit function global if (single statement) if (multiple statements) if (nested statements) next on pass repeat repeat for repeat forever repeat until repeat while repeat with return send What is a property? autoHilite autoTab backColor blindTyping borderColor bottom bottomRight brush cantDelete cantModify centered colorSet cursor dontSearch dragSpeed editBkgnd family filled frameColor freeSize grid height hilite icon iconBackColor iconFrontColor ID itemDelimiter language lastError left lineSize loc[ation] lockErrors lockMessages lockRecent lockScreen lockText multiple multiSpace name number (property) numberFormat outlined pattern polySides powerKeys printTemplate recentHomeCard rect[angle] right script scroll sharedHilite sharedText showLines showName showPict size style textAlign textArrows textColor textFont textHeight textSize textStyle top topLeft useColorSet userLevel userModify version visible wideMargins width What is a system message? arrowKey (system message) closeBackground closeCard closeField closeStack controlKey (system message) deleteBackground deleteButton deleteCard deleteField deleteStack doMenu (system message) enterInField enterKey (system message) functionKey (system message) help (system message) hide (system message) idle mouseDown mouseEnter mouseLeave mouseStillDown mouseUp mouseWithin newBackground newButton newCard newField newStack openBackground openCard openField openStack quit resume returnInField returnKey (system message) show (system message) startUp suspend tabKey (system message) &Click a topic . . . *HyperTalk Basics System messages Control structures Commands Functions Properties Operators & Constants HyperTalk HelpClick a subtopic. HyperTalk Help is your on-line reference to HyperCards scripting language. This stack is more helpful to you after youve gone through the book HyperTalk Beginners Guide for the Apple IIGS, which came with your copy of HyperCard. You can use Apple Computers book HyperCard Script Language Guide for the Apple IIGS (available from Addison-Wesley) with or instead of this stack. First Card----------------- Script info for this Card----------------- HANDLERS: openCard showTopic Size of script: 722 chars. ----------------------------------------------------------- on openCard global OpenFieldName if OpenFieldName is not empty then lock screen set the hilite of cd btn OpenFieldName to true show cd fld OpenFieldName show bg btn "No2" show cd fld "subtopic 1" unlock screen end if end openCard on showTopic global OpenFieldName set cursor to 4 put the short name of the target into buttonClicked lock screen if OpenFieldName is not empty then hide cd fld OpenFieldName show cd fld buttonClicked set scroll of cd fld buttonClicked to 0 put buttonClicked into OpenFieldName show bg btn "No2" show cd fld "subtopic 1" hide cd fld "about" unlock screen wait while the mouseClick -- Gets rid of additional mouse clicks. end showTopicCARD z0JOF31HyperTalk Basics Using HyperTalk Help 1 of 2* This stack is separate from the HyperCard IIGS Help stack. You get to the HyperTalk Help stack by clicking HyperTalk when youre in HyperCard IIGS Help. (Similarly, you can go back to HyperCard IIGS Help by clicking HyperCard below.) You use HyperTalk Help as you would HyperCard IIGS Help, with one difference: Clicking Examples, when its not gray, shows you ways to use the HyperTalk element described on the card. (Examples replaces the Demo button thats in HyperCard IIGS Help; however, several cards have a Demo button to the right of the text that demonstrates a HyperTalk concept when you click it.) /What is HyperTalk? +You can go to HyperTalk Help directly from any stack by choosing Open Stack from the File menu and, in the dialog box that appears, locating and opening the HyperTalk Help stack (you may have to insert the disk that contains it). Choosing Help from the Go menu takes you to HyperCard IIGS Help, not to HyperTalk Help.Ps Ps cUsing HyperTalk HelpCARD(z0J LFH31HyperTalk Basics Using HyperTalk Help 2 of 2* The syntax of HyperTalk statements is often shown with text in or [square brackets]. Do not type the brackets in your scripts. Text in is a placeholder, which you need to replace in an actual HyperTalk statement. Text in [square brackets] is optional; you include it when appropriate.Ps Ps @CARDz0J1LF3HyperTalk Basics What is HyperTalk? 1 of 1* Handlers Scripts HyperTalk is HyperCards scripting language. It lets you write English-like statements that tell HyperCard what to do in response to certain events, such as when you click a button, close a card, or open a stack. The response to an event is defined in a handler, which is made up of HyperTalk statements. You can write a handler for every event you want responded to (or handled). A collection of handlers is called a script. Every HyperCard object--button, field, card, background, stack--has a script that tells the object how to handle specific events. (A script is sometimes empty, so the object does nothing.) /Looking at scripts +If youve successfully used the Message box, youve used HyperTalk, which can be as English-like as go next card. Any text you type in the Message box has to be in HyperTalk for HyperCard to understand it. Ps Ps cWhat is HyperTalk?CARD_z0J @3FHyperTalk Basics Messages and objects 1 of 3* HyperCard waits for events to happen. When they do (when you click a button, close a card, open a stack), HyperCard figures out (1) what announcements to make and (2) where to send them. The announcements are called messages, which are HyperTalk translations for events. The messages are sent to HyperCard objects--buttons, fields, cards, backgrounds, and stacks--and to HyperCard itself. /Message handlers Looking at scripts What is a control structure? What is a system message? on Ps Ps cMessages and objectsCARDHz0J  8x30 status _m( Demoon mouseEnter put "mouseEnter" into cd fld id 8 end mouseEnter on mouseWithin put "mouseWithin" into cd fld id 8 end mouseWithin on mouseLeave put "mouseLeave" into cd fld id 8 end mouseLeave on mouseDown put "mouseDown" into cd fld id 8 end mouseDown on mouseStillDown put "mouseStillDown" into cd fld id 8 end mouseStillDown on mouseUp put "mouseUp" into cd fld id 8 end mouseUpGF3HyperTalk Basics Messages and objects 2 of 3 A click of the mouse is often perceived as a single event, but its actually a series of events that translates into a series of at least two messages: mouseDown (when you press the mouse button) and mouseUp (when you release it). To see how HyperCard translates events into messages, move the pointer to the Demo button at right and click. Message:Ps Ps on closeCard put empty into cd fld id 8 pass closeCard end closeCard CARDz0J 73HyperTalk Basics Messages and objects 3 of 3* HyperCard sends each message to the object where the event takes place (usually, the object you act on--the button you click or the stack you open). When a HyperCard object receives a message, it responds according to its script, which may contain a handler for that message. If it does contain a handler, the object handles the message. If it doesnt, the message goes on to the next object in the message-passing order./What is HyperTalk? Referring to objects The message-passing order Ps Ps @CARDz0J 1 The message-passing orderHyperTalk Basics The first object that receives a message doesnt have to be the one that handles it. HyperCard first sends a message to a specific button or field (whether its in the background or on the card) or to the current card. If that object doesnt have a handler for the message in its script, the message goes on to the next object in the message-passing order: 1. a button or a field 2. the current card 3. the current background 4. the current stack 5. the Home stack 6. HyperCard itself +You can bypass the message-passing order and send a message directly to an object, as in: send "show menuBar" to HyperCard send "mouseUp" to button "Brass" 1 of 3cThe message-passing orderCARD.z0J 3 The message-passing orderHyperTalk Basics The message continues through the message-passing order until it reaches an object whose script contains a handler for it. The message is intercepted there, unless the handler relays the message to the next object in the message-passing order using the pass control structure. When a message isnt intercepted and gets to HyperCard itself, nothing happens if its a system message (for example, mouseUp). If the message is a command, HyperCard executes it (for example, HyperCard adds another card to the current stack when it gets the message doMenu "New Card"). The next card shows how the message-passing order works. /pass 2 of 3` CARDܸ%9z0J &4B btnon mouseUp set hilite of cd btn "btn" to true flash 2 wait 15 set hilite of cd btn "btn" to false set hilite of cd btn "cd" to true wait 15 set hilite of cd btn "cd" to false set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true flash 1 wait 15 set hilite of cd btn "stack" to false end mouseUp 4B1 fldon mouseUp set hilite of cd btn "fld" to true wait 15 set hilite of cd btn "fld" to false set hilite of cd btn "cd" to true wait 15 set hilite of cd btn "cd" to false set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true flash 1 wait 15 set hilite of cd btn "stack" to false end mouseUp FFT/ cdon mouseUp set hilite of cd btn "cd" to true wait 15 set hilite of cd btn "cd" to false set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true flash 1 wait 15 set hilite of cd btn "stack" to false end mouseUp Vd/ bkgndon mouseUp set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true flash 1 wait 15 set hilite of cd btn "stack" to false end mouseUp ft/ stackon mouseUp set hilite of cd btn "stack" to true flash 1 wait 15 set hilite of cd btn "stack" to false end mouseUp v/ Homeon mouseUp set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp / HyperCardon mouseUp set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp 2:c 2 h  The message-passing orderHyperTalk Basics Click any of the boxes at right to see how the mouseUp message might be handled and passed. 3 of 3on mouseUp flash 2 pass mouseUp end mouseUpon mouseUp flash 1 end mouseUp`BMAP%99N9Nu  ( ??0<! 0+#* #  $#+#   !( ??00<p! 0 ?+#*  #    $#+#333@CARDz0JT kT|' Demoon mouseUp flash 2 end mouseUp1FG3HyperTalk Basics Message handlers 1 of 1 A message handler is a set of HyperTalk statements that define how an object responds when it receives a specific message. Handlers are contained in the objects script. The first line of every handler starts with the on keyword followed by the name of the message that the handler is for. The last line starts with the end keyword followed by the name of the message. Click Demo at right to see how it handles the mouseUp message./The message-passing order Handlers within handlers on end * on mouseUp flash 2 end mouseUpPs Ps cMessage handlers`CARDB!z0J 13HyperTalk Basics Handlers within handlers 1 of 3*Statements as messages As a handler runs, each statement in the handler is sent as a message--first to the object whose script contains the handler, then to the next object in the message-passing order, and so on. (When you click Demo on the previous card, flash 2 is sent as a message that goes through the message-passing order to HyperCard itself, which responds by executing the command.) This behavior makes it possible for a handler to call another handler that comes later in the script or is contained in the script of an object thats later in the message- passing order. +You can write complex scripts by breaking them into subprocedures and writing handlers to perform each subprocedure. The handler for the main procedure can then simply call the handlers for subprocedures as necessary. For example, the handler below calls a series of handlers, each performing part of a larger procedure: on openCard getNumbers -- call handler named getNumbers computeData -- call handler named computeData displayResults -- call handler named displayResults end openCard /Message handlers The message-passing order on Ps Ps cHandlers within handlers CARD"lz0J  4B btnon mouseUp set hilite of cd btn "btn" to true beep 2 wait 15 set hilite of cd btn "btn" to false end mouseUp : 4B1 fldon mouseUp set hilite of cd btn "fld" to true wait 15 set hilite of cd btn "fld" to false set hilite of cd btn "cd" to true wait 15 set hilite of cd btn "cd" to false set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true wait 15 set hilite of cd btn "stack" to false set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp  FT/ cdon mouseUp set hilite of cd btn "cd" to true wait 15 set hilite of cd btn "cd" to false set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true wait 15 set hilite of cd btn "stack" to false set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp  Vd/ bkgndon mouseUp set hilite of cd btn "bkgnd" to true wait 15 set hilite of cd btn "bkgnd" to false set hilite of cd btn "stack" to true wait 15 set hilite of cd btn "stack" to false set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp L ft/ stackon mouseUp set hilite of cd btn "stack" to true wait 15 set hilite of cd btn "stack" to false set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp v/ Homeon mouseUp set hilite of cd btn "Home" to true wait 15 set hilite of cd btn "Home" to false set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp / HyperCardon mouseUp set hilite of cd btn "HyperCard" to true wait 15 set hilite of cd btn "HyperCard" to false end mouseUp 2;[ 2h O1HyperTalk Basics Handlers within handlers 2 of 3 Click any of the boxes at right to see how the mouseUp handler calls the doubleBeep handler. +You can effectively write your own commands by writing handlers for messages that you have other handlers send. Make sure the handler that sends the message is earlier in the message-passing order than the one that handles the message. Putting a HyperTalk statement in a handler is not the only way to send a message. You can type the message in the Message box and press the Return key.on mouseUp doubleBeep end mouseUpon doubleBeep beep 2 end doubleBeepPs Ps `BMAPl9N9Ny  !(  ! +#'" " $#+"  !( ??00<p! 0 ?+#'" #    $#+"333`CARDz0J 3O Handlers within handlersHyperTalk Basics When a handler calls another handler, it can pass values (known as parameters) to the called handler. The called handler must have the parameter names defined as local variables. The values must be separated by commas and passed in the same order in which they are to be received. The mouseUp handler shown in Examples calls the sayMessage handler and passes two values ("red" and "apple") for the parameter names ("color" and "fruit") in the called handler. (You can use the parameter names anywhere in the called handler.)/Using variables Qon mouseUp sayMessage "red", "apple" end mouseUp on sayMessage color, fruit put "I want a" && color && fruit into the Message box end sayMessage 3 of 3@CARDz0J O A function is a handler that computes a value and returns the value to the calling handler. HyperCard has many built-in functions, and you can also write your own. A function handler always begins with the function control structure followed by the name of the function. The value computed by the handler is returned to the calling handler using the return control structure. The square function shown in Examples receives the value 5 from the calling mouseUp handler, attaches it to the parameter variable x, and returns the square of the value. Function handlersHyperTalk BasicsQon mouseUp put square(5) into the Message box end mouseUp function square x return (x * x) end square 1 of 1cFunction handlers CARD#z0J$ 3HyperTalk Basics Getting values 1 of 5* number literal boolean Basically, HyperTalk scripts manipulate values. A value is either a string of text characters or a number. You can supply the value directly, or you can write an expression that HyperCard evaluates to get the value. The value of a number is the number itself (7, 16, 39.3). The value of a literal is any string of characters between double quotation marks. Expression: "What, me worry?" Value: What, me worry? A boolean value is either true or false. /Using variables Referring to objects What is a function? What is a property? put get set Ps Ps cGetting values@CARD! z0J A constant is a named value that never changes. Expression: pi Value: 3.14159265358979323846 The value of a field is whatever that field contains. Expression: background field "address" Value: 2007 Poplar Av The value of the selection is whatever is currently selected in a field. The value of the message box is whatever the Message box contains.*constant field the selection Message box 2 of 5 Getting valuesHyperTalk BasicsCARDLz0JZ The value of a variable is whatever it contains. You create a variable by giving it a name and putting whatever you want in it. (Dont put quotes around the name of a variable.) Expression: totalHours Value: 40 A property is a value describing a characteristic of a HyperCard object or the HyperCard environment. Expression: the number of this card Value: 16 A function is a value that HyperCard calculates as it executes a statement in which the function is used. *variable property function 3 of 5 Getting valuesHyperTalk Basics@CARDjz0J Expression: the time Value: 10:00 AM The value of a chunk expression is the part or the range of parts the chunk you specify within a field or other source of value. You can specify chunks in terms of: lines (separated by Return characters) items (separated by commas) words (separated by spaces) characters Expression: word 2 of item 1 of "the butcher, the baker" Value: butcher * chunk 4 of 5 Getting valuesHyperTalk BasicsCARD-z0J*operator An operator is a character or group of characters that lets you build values by manipulating parts of an expression. Expression: "See you at" && (2*3) & "!" Value: See you at 6! The ampersand (&) operator combines two text strings. The double ampersand (&&) combines two strings with a space between them. 5 of 5 Getting valuesHyperTalk Basics`CARD)z0J 13HyperTalk Basics Using variables 1 of 2* Local variables It Variables are either local or global. A variable is local unless you declare it global. You use a local variable to store a temporary value that you use within a handler. When the handler is finished executing, the value of the local variable is cleared from the computers memory. Some HyperTalk commands automatically put values into a local variable called It./put get global Ps Ps cUsing variables CARD*z0J HyperTalk Basics Using variables 2 of 2*Global variables You use a global variable to store a value that is used in more than one handler or used more than once by a single handler. The value of a global variable stays in the computers memory until youquit HyperCard. To declare a global variable, you must use the global keyword. For example: global timeZone establishes timeZone as a global variable.+You should initialize (put an initial value into) a global variable the first time you use it. If you used another stack with a global variable of the same name and have not restarted your computer since then, the current stack may take the value of the global variable from the other stack. Your script should clear the contents of all global variables when you close a stack (for example, a closeStack handler in the stack script). Otherwise, the variables will take up space in memory unnecessarily. Ps Ps CARD+z0J MG13HyperTalk Basics Referring to objects 1 of 3* name When writing scripts, you can refer to objects by name, ID, number, ordinal, position, me or the target. An objects name is the value in its Info dialog box (for example, background button "Home"). Always enclose an objects name in double quotes so that HyperCard recognizes it literally and doesnt look for a variable by that name. You can use a stacks path name, which includes names of the volume, any directories, and the stack itself, separated by colons (stack ":myDisk:myFolder:myStack"). +You have to specify card field and background button when you refer to those objects. If you type field, HyperCard assumes you mean a background field, and if you type button, HyperCard assumes you mean a card button. Ps Ps cReferring to objectsCARDQz0J An objects ID is a unique number assigned by HyperCard when it creates the object (for example, card ID 5734). You can find it in the objects Info dialog box (stacks do not have an ID). Object ID numbers ever change. An objects number represents its position within the object that contains it (for example, card 2). Buttons and fields are ordered within a card or background. Cards and backgrounds are ordered within a stack. You can refer to an objects position within the object that contains it using the ordinals first through tenth (for example, second card). *ID number ordinal 2 of 3HyperTalk Basics Referring to objectsCARDBz0Jc You can refer to an objects position within the object that contains it using any of the following terms: middle, last, any, next, previous, recent, and this (for example, the last card of this background). You can refer to an object asme in a handler thats in the objects script (for example, set the hilite of me to true). You can refer to an object as the target when the message currently being handled was first received by that object (for example, set the hilite of the target to true).*position me the targetHyperTalk Basics 3 of 3 Referring to objects CARDk3z0J 13HyperTalk Basics Looking at scripts 1 of 3* button Before you can read, edit, and write scripts, the user level must be set to scripting, or 5. To open a button script, you can: Select a button using the Button tool, choose Button Info from the Objects menu, and click Script. Hold down -Option to peek at the buttons and click one. Choose the Button tool and hold down the Shift key while you double-click a button. cLooking at scriptsCARDXz0J5 To open a field script, you can: Select a field using the Field tool, choose Field Info from the Objects menu, and click Script. Hold down Shift--Option to peek at the fields and click one. Choose the Field tool and hold down the Shift key while you double-click a field. To open a card script, you can: Choose Card Info from the Objects menu and click Script. Hold down the Shift key while you choose Card Info from the Objects menu. Hold down -Option and press C. *field cardHyperTalk Basics 2 of 3 Looking at scripts@CARD;hz0J To open a background script, you can: Choose Background Info from the Objects menu and click Script. Hold down the Shift key while you choose Background Info from the Objects menu. Hold down -Option and press B. To open a stack script, you can: Choose Stack Info from the Objects menu and click Script. Hold down the Shift key while you choose Stack Info from the Objects menu. Hold down -Option and press S. *background stackHyperTalk Basics 3 of 3 Looking at scriptsCARDHz0Jo Writing your own handlersHyperTalk Basics When you write handlers for an objects script, you need to decide (1) which messages you want the object to handle and (2) what you want to happen when each handler runs. Be aware of the objects position in the message-passing order, and remember that a message does not have to be handled by the first object that receives it. Also, remember that each statement in a handler is sent as a message as the handler runs, so you can have a handler call another handler thats later in the message-passing order (in effect, you can write your own commands). 1 of 5cWriting your own handlers CARD4h1J 13HyperTalk Basics Writing your own handlers 2 of 5* Return Soft Return Double hyphen When youre writing handlers: Press the Return key at the end of each statement. If a statement needs to be longer than a single line, press Option-Return to start another line without starting another statement. This key combination enters a soft return, represented by in scripts. Do not use soft returns inside a literal expression (anything between quotes). Type a double hyphen (--) to introduce a comment. HyperCard ignores any part of a statement that follows a double hyphen when it executes the handler./Looking at scripts Synonyms and abbreviations +Be liberal about adding comments to handlers and statements within handlers. Your comments will help you remember what you want the handler to do and help others understand what the handler is doing. Reading a well- commented script is one of the best ways to learn scripting. @CARDB5h1JHyperTalk Basics Writing your own handlers 3 of 5*Tab Cut Copy Paste Press the Tab key to format a script. Formatting a script is an elementary form of debugging: if your statements do not indent properly, then something is wrong (youre probably misusing or missing a control structure). Press -X to cut the selection to the Clipboard. Press -C to copy the selection to the Clipboard. Press -V to paste the contents of the Clipboard at the insertion point.  CARD6h1JHyperTalk Basics Writing your own handlers 4 of 5*Find Find again Find select Select all Print Press -F to find a text string in the script, or click the Find button. Press -G to find the next occurrence of the text string. Press -H to find the next occurrence of the selection. Press -A to select the entire script. Press -P to print the script or the selection within the script, or click the Print button. `CARD7h1J HyperTalk Basics Writing your own handlers 5 of 5 To close the script and save any changes, click OK or press the Enter key. To close the script without saving changes, click Cancel, press the Escape key or press -. (-period). *OK CancelCARD`h1J When you write a handler and try it out, HyperCard lets you know when it doesnt work and suggests why in a dialog box. The dialog box lets you either cancel running the rest of the script (by clicking the Cancel button) or open the script (by clicking Script) so you can find out whats going on. When you open the script, the blinking insertion point is in the line where your handler stopped running. Bugs in handlers are most often caused by missing or misused control structures, faulty syntax, or invalid values. Click Tips for information on a few simple debugging techniques. (As your HyperTalk skills improve, you can write handlers specifically for debugging your scripts.) Debugging scriptsHyperTalk Basics+To check the value of a function or variable, open the Message box and type ask "The value is" with and press Return, where is the name of the variable or function whose value youre checking. (You can type any text instead of The value is.) To check whether control ever reaches a certain handler or a particular part of the handler, you can set off handlers or blocks of statements within handlers by inserting answer statements where appropriate. For example, if you insert the statement answer "Checkpoint 1" at the end of a handler or after a particular statement within the handler, a dialog box displays Checkpoint 1 (or any other text you specified) as the handler is executed. Remember to remove these debugging statements when you finalize your handlers. 1 of 1cDebugging scriptsCARD8h1J<<'30 body text HyperTalk Basics Synonyms and abbreviations 1 of 1 abbr, abbrev, abbreviated bg, bkgnd, background bgs, bkgnds, backgrounds btn, button btns, buttons cd, card cds, cards char, character chars, characters cmdKey, commandKey fld, field flds, fieldsgray, grey loc, location msg, msg box, message, message box mid, middle pict, picture prev, previous rect, rectangle reg poly, regular polygon round rect, round rectangle sec, secs, seconds spray, spray can tick, tickscSynonyms and abbreviations`CARD:h1J F3System messages What is a system message? 1 of 1 System messages are sent to an object to announce the occurrence of an event, such as a mouse click or the creation or deletion of an object./Message handlers The message-passing order on cWhat is a system message?CARD;h1J HO3System messages arrowKey (system message) 1 of 1* arrowKey is sent to the current card when an arrow key is pressed (and the textArrows property is false). If the arrowKey message is not intercepted, HyperCard executes the arrowKey command. on arrowKey end arrowKey The expression yields up, down, left, or right./arrowKey (command) Qon arrowKey whichKey if the optionKey is down then if whichKey is "left" then go previous card end if else pass arrowKey end if end arrowKeycarrowKey (system message)CARD=h1J R31FSystem messages closeBackground 1 of 1 closeBackground is sent to the current card when you go to a card whose background is different from that of the current card, or when you quit HyperCard. on closeBackground end closeBackground /openBackground closeCard closeStack closeField ccloseBackground`CARDY>h1J 13System messages closeCard 1 of 1* closeCard is sent to the current card when you go to another card or when you quit HyperCard. on closeCard end closeCard /openCard closeBackground closeStack closeField ccloseCardCARD?h1J :13System messages closeField 1 of 1* closeField is sent to an unlocked field when it is closed after text editing. The closeField message is sent only if you have made text changes. on closeField end closeField /openField closeCard closeBackground closeStack ccloseField@CARD@h1J 13System messages closeStack 1 of 1* closeStack is sent to the current card when you close a stack by opening another stack. on closeStack end closeStack /openStack closeCard closeBackground closeField ccloseStackCARDAh1JO1G3System messages controlKey (system message) 1 of 1 controlKey is sent to the current card when you press the Control key and another key together. on controlKey end controlKey yields a number from 0 to 255 thats generated by a keystroke on the Apple IIGS keyboard. Click Tips to see a table of keystrokes and their corresponding numbers. +Key pressed with Number passed: Control key: 2 (Keyboard) 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h, Left Arrow 8 i, Tab 9 j, Down Arrow 10 k, Up Arrow 11 l 12 m, Enter, Return 13 n 14 o 15 p 16 q 17 r 18 s 19 t 20 u, Right Arrow 21 v 22 w 23 x, Clear 24 y 25 z 26 Esc, [ 27 \ 28 ] 29 6 (Keyboard) 30 Hyphen (-) 31 Single quotation Mark (') 39 Asterisk (*) 42 Plus (+) 43 Comma (,) 44 Minus (-) 45 Period (.) 46 Slash (/) 47 0 48 1 49 2 (Keypad) 50 3 51 4 52 5 53 6 (Keypad) 54 7 55 8 56 9 57 Semicolon (;) 59 Equal (=) 61 Tilde (~) 96 Function Keys 1 122 2 120 3 99 4 118 5 96 6 97 7 98 8 100 9 101 10 109 11 103 12 111 13 105 14 107 15 113 Forward Delete 117 Delete 127Qon controlKey whichKey if whichKey = 16 then --user typed Control-P: doMenu "Print Card" else pass controlKey end if end controlKey/controlKey (command)ccontrolKey (system message)CARDCh1J #13System messages deleteBackground 1 of 1* deleteBackground is sent to the current card when its background is about to be deleted. on deleteBackground end deleteBackground /newBackground deleteButton deleteCard deleteField deleteStack cdeleteBackground`CARDDh1J G13System messages deleteButton 1 of 1* deleteButton is sent to a button that youre deleting, just before it is deleted. on deleteButton end deleteButton /newButton deleteBackground deleteCard deleteField deleteStack cdeleteButton`CARDEh1J 13System messages deleteCard 1 of 1* deleteCard is sent to a card that youre deleting, just before it is deleted. on deleteCard end deleteCard /newCard deleteBackground deleteButton deleteField deleteStack cdeleteCard`CARDoFh1J 13System messages deleteField 1 of 1* deleteField is sent to a field that youre deleting, just before it is deleted. on deleteField end deleteField /newField deleteBackground deleteButton deleteCard deleteStack cdeleteFieldCARDGh1J &13System messages deleteStack 1 of 1* deleteStack is sent to the current card of the stack that youre deleting, just before the stack is deleted. on deleteStack end deleteStack /newStack deleteBackground deleteButton deleteCard deleteField cdeleteStackCARDHh1J I13System messages doMenu (system message) 1 of 1 doMenu is sent to the current card when you select a menu item. If the doMenu message isnt intercepted, HyperCard executes the doMenu command. on doMenu end doMenu yields the name of a menu item.+Menu item names must be exact, including the three periods (with no spaces) following menu items that bring up dialog boxes. Uppercase and lowercase dont matter, but you must type the three periods--dont use the Option-semicolon ellipsis character./doMenu (command) Ps Ps cdoMenu (system message)@CARDIh1J 31System messages enterInField 1 of 1* enterInField is sent to a field when you press the Enter key while the insertion point or the selection is in the field. If the enterInField message is not intercepted by a handler and the contents of the field have been changed, HyperCard sends the closeField message. on enterInField end enterInField /enterKey (system message) enterKey (command) Ps Ps centerInFieldCARDJh1J 13System messages enterKey (system message) 1 of 1* enterKey is sent to the current card when you press the Enter key, unless the insertion point is in a field (in which case the message is sent to the field). If the enterKey message is not intercepted, HyperCard executes the enterKey command. on enterKey end enterKey /enterKey (command) enterInField centerKey (system message)CARDKh1J 13System messages functionKey (system message) 1 of 1 functionKey is sent to the current card when you press a function key on the Apple Extended Keyboard. If the functionKey message is not intercepted, HyperCard executes the functionKey command. on functionKey end functionKey yields a number from 1 to 15 that corresponds to one of the function keys. The function keys from 1 to 4 are already programmed for Undo, Cut, Copy, and Paste, respectively.+ The functionKey command only has built-in actions for keys 1 through 4. These keys implement the Undo, Cut, Copy, and Paste commands, respectively. You can override the preprogrammed functions of keys 1 through 4 in a functionKey message handler. /functionKey (command) Qon functionKey whichKey if whichKey is 5 then doMenu "New Card" else if whichKey is 6 then choose browse tool else if whichKey is 7 then choose button tool else pass functionKey end if end functionKeycfunctionKey (system message)CARDMh1J w3System messages help (system message) 1 of 1* help is sent to the current card when you choose Help from the Go menu (or press -?). You can intercept this message to provide your own Help system for your stack. If the help message is not intercepted, HyperCard executes the help command. on help end help /help (command) chelp (system message)CARD h1J2System messages hide (system message) hide is sent to the current card when the menu bar is visible and you press -Space bar. on hide menubar end hide This message is also a HyperTalk command; the command accepts parameters other than menubar./hide (command) 1 of 1chide (system message)CARDNh1J \31System messages idle 1 of 1* idle is sent repeatedly to the current card when nothing is happening and the Browse tool is selected. on idle end idle +An idle handler can interfere with typing. For example, if you have an idle handler that puts text into a field, it can remove the insertion point from another field while the user is typing. An example of such a handler is on idle put the time into card field "Time" pass idle end idle If this handler were to run while you were typing into another field (idle is sent during a typing pause), and if the time had changed, HyperCard would remove the insertion point from the field you were in, and you would have to click in the field or press Tab to replace the insertion point after every pause, which would be annoying and tedious. cidleCARDOh1J 931System messages mouseDown 1 of 1* mouseDown is sent to a button or a locked field when you press the mouse button while the pointer is inside the button or fields rectangle. When the pointer is anywhere else, the message is sent to the current card. on mouseDown end mouseDown +MouseDown is not sent to a scrolling field when the mouse is clicked in the scroll bar. You can send mouseDown to an unlocked field by holding down the Command key while clicking the mouse in the field. /mouseUp mouseStillDown cmouseDown@CARDPh1J 13System messages mouseEnter 1 of 1* mouseEnter is sent to a button or field as soon as you move the pointer into its rectangle. on mouseEnter end mouseEnter /mouseLeave mouseWithin cmouseEnter@CARD Qh1J 13System messages mouseLeave 1 of 1* mouseLeave is sent to a button or field as soon as you move the pointer outside its rectangle. on mouseLeave end mouseLeave /mouseEnter mouseWithin cmouseLeaveCARDRh1J 13System messages mouseStillDown 1 of 1* mouseStillDown is sent repeatedly to a button or locked field while you hold down the mouse button and the pointer is inside the button or fields rectangle. When the pointer is anywhere else, the message is sent to the current card. on mouseStillDown end mouseStillDown /mouseDown mouseUp cmouseStillDownCARDpSF<J 213System messages mouseUp 1 of 1* mouseUp is sent to a button or a locked field when you release the mouse button while the pointer is inside the button or fields rectangle. When the pointer is anywhere else, the message is sent to the current card. on mouseUp end mouseUp + MouseUp is not sent to a scrolling field when the mouse is clicked in the scroll bar. You can send mouseUp to an unlocked field by holding down the Command key while clicking the mouse in the field. /mouseDown mouseStillDown cmouseUp@CARDTF<J 13System messages mouseWithin 1 of 1* mouseWithin is sent repeatedly to a button or field while the pointer is inside its rectangle. on mouseWithin end mouseWithin /mouseEnter mouseLeave cmouseWithinCARDUF<J &13System messages newBackground 1 of 1* newBackground is sent to the first card of a new background as soon as the background has been created. on newBackground end newBackground /openBackground deleteBackground newButton newCard newStack cnewBackground@CARDVF<J 13System messages newButton 1 of 1* newButton is sent to a button as soon as you create it. on newButton end newButton /deleteButton newBackground newCard newField newStack cnewButton@CARDDWF<J 13System messages newCard 1 of 1* newCard is sent to a new card as soon as you create it. on newCard end newCard /openCard deleteCard newBackground newButton newField newStack cnewCard@CARDYF<J 13System messages newField 1 of 1* newField is sent to a field as soon as you create it. on newField end newField /openField deleteField newBackground newButton newCard newStack cnewFieldCARDZF<J *13System messages newStack 1 of 1* newStack is sent to the current card (in this case, the first card of the new stack) as soon as the stack has been created. on newStack end newStack /openStack deleteStack newBackground newButton newCard newField cnewStackCARD[F<J =13System messages openBackground 1 of 1* openBackground is sent to the current card when you go to a card whose background is different from that of the most recent card. on openBackground end openBackground /closeBackground newBackground openCard openField openStack copenBackground CARDX\F<J 3System messages openCard 1 of 1* openCard is sent to a card when you go to that card. on openCard end openCard /closeCard newCard openBackground openField openStack copenCardCARD]F<J }13System messages openField 1 of 1* openField is sent to an unlocked field when it is opened for text editing. You open a field for editing by either clicking in the field or pressing the Tab key when the insertion point is in the previous field. on openField end openField /closeField newField openBackground openCard openStack copenFieldCARD^F<J 13System messages openStack 1 of 1* openStack is sent when you go to a card in a different stack from that of the most recent card. In this case, the following three messages are sent to the current card (the card in the newly opened stack) in order: openCard, openBackground, and openStack. on openStack end openStack /closeStack newStack openBackground openCard openField copenStack@CARD_F<J 13System messages quit 1 of 1* quit is sent to the current card when you choose Quit HyperCard from the File menu (or press -Q), just before HyperCard quits. on quit end quit /startUp cquit CARD`F<J 13System messages resume 1 of 1* resume is sent to the current card when HyperCard resumes running after having been suspended. on resume end resume /suspend cresumeCARDF<JSystem messages returnInField returnInField is sent to a field when you press the Return key while the insertion point or the selection is in the field. If the message is not intercepted, HyperCard sends a tabKey message to the field when the following conditions are true: the fields autoTab property is true the field is not a scrolling field the insertion point or selection is on the last line. Otherwise, HyperCard inserts a return character into the field. The tabKey message, if its not intercepted, causes HyperCard to place the insertion point in the next field. 1 of 1/returnKey (system message) returnKey (command) creturnInFieldCARDaF<J u13System messages returnKey (system message) 1 of 1* returnKey is sent to the current card when you press the Return key and the text insertion point is not in a field. If the returnKey message is not intercepted, HyperCard executes the returnKey command. on returnKey end returnKey /returnKey (command) returnInField creturnKey (system message)CARDF<J53System messages show (system message) show is sent to the current card when the menu bar is hidden and you press -Space bar. on show menubar end show This message is also a HyperCard command; the command accepts parameters other than menubar./show (command) 1 of 1cshow (system message) CARDbF<J 13System messages startUp 1 of 1* startUp is sent to the first card displayed when HyperCard starts up. on startUp end startUp /openStack openBackground openCard quit cstartUp`CARD}cF<J 13System messages suspend 1 of 1* suspend is sent to the current card when you launch an application from HyperCard with the open command, just before the application is launched. on suspend end suspend /resume csuspendCARDdF<J 813System messages tabKey (system message) 1 of 1* tabKey is sent to the current card when you press the Tab key. If the tabKey message is not intercepted, HyperCard executes the tabKey command. on tabKey end tabKey + If the insertion point is in a field, HyperCard still sends the tabKey message. Thus placing the following handler in a card or background script will prevent the user from using the Tab key to advance the insertion point to the next field: on tabKey beep end tabKey /tabKey (command) ctabKey (system message)CARDeF<J G3Control structures What is a control structure? 1 of 1 Control structures are blocks of HyperTalk statements marked with internally defined words (called keywords) that enable you to control the order or conditions under which the statements are executed. Handlers are control structures. Within handlers themselves, if structures and repeat structures are the most common control structures. cWhat is a control structure?`CARD`fF<J O1G3Control structures do 1 of 1 do do causes HyperCard to evaluate and then send the value as a message to the current card. If the value contains more than one line (if, for example, it is the contents of a field), only the first line is sent. + cannot be a function handler; to do function calls, use the get command: do "get" && the Qon mouseUp do "play" && quote & "boing" & quote end mouseUpPs Ps cdo@CARDF<JControl structures end end end if end repeat end marks the last line of a handler, if structure, or repeat structure. It is reached when all of the structures statements have been executed (except for any conditional statements that were bypassed). When the end statement is reached, control passes from a message handler to the next handler, from a function handler back to the calling handler, or from an if structure or repeat structure to the next statement in the handler. 1 of 1cend@CARDggF<J O13Control structures exit 1 of 1 exit exit repeat exit to HyperCard Within a handler, the exit statement sends control to the end statement, ending the handlers execution. Within a repeat structure, the exit statement ends execution of the loop regardless of the state of the controlling conditions specified in the repeat statement. The exit to HyperCard statement sends control to HyperCard, bypassing any pending handlers. /on if (single statement) if (multiple statements) repeat Qput 1 into the Message box repeat with increment = 1 to 100 add increment to the Message box if Message box > 20 then beep 5 exit repeat end if end repeat Ps Ps cexit CARDiF<J 13Control structures function 1 of 1 function [] [return ] end The function statement marks the start of a function handler. allows a function handler to receive values for the listed parameters from the handler that calls the function. (HyperCard evaluates any items enclosed in parentheses in the function call statement of the calling handler and assigns those items as parameter values when the function handler is executed.) +Use the return statement to have the function handler return a value. If you do not use the return statement, the function will always return empty as its value. /return cfunctionCARDBkF<J IO13Control structures global 1 of 1 global is a list of variable names set off by commas. The global statement makes a variable and its contents available to any script of any object. You must include the global statement in each handler that uses the global variable. Changing the value of a global variable in any script changes its value in all scripts. The value is not saved between HyperCard sessions or when you suspend HyperCard by launching another application with the open command. /Using variables Q-- Shows how a global variable is used by 2 handlers on mouseUp global myVariable -- load the global here put 3 into myVariable putResult end mouseup on putResult global myVariable put myVariable -- the value remains 3 end putResultcglobalCARDmF<JO1G3Control structures if (single statement) 1 of 1 if then [else ] if then [else ] The if statement tests for the specified condition and executes one statement if the condition is true. If the condition is false, the optional else branch is executed. In a single-statement if structure, you do not need an end statement.+If structures can be used only within message handlers or function handlers. /if (multiple statements) Qon simpleIfDemo ask "Enter a number from 1 to 5" if (it 1) AND (it 5) then beep it else play "boing" end simpleIfDemo cif (single statement)CARDnF<J{GControl structures if (multiple statements) 1 of 2 if then [else ] end if if then [else ] The if statement tests for the specified condition and executes one or more statements if the condition is true. If the condition is false, the optional else branch is executed.cif (multiple statements)CARD'oF<JControl structures if (multiple statements) 2 of 2 At the end of a multiple-statement if structure, you must include either an end statement or a single-statement else clause. CARDpF<J y13Control structures if (nested statements) 1 of 2 if then [else if then ] [else ] end if The nested if statement tests for the specified condition and executes one or more statements if the condition is true. The optional else if forms allow alternative branches to be taken. +If structures can be used only within message handlers or function handlers. If structures can be nested; that is, statements following a then or an else can include more if structures. Each nested multiple-line if structure must have its own end if, and an else always goes with the closest preceding if clause: repeat ask "Guess a number between 1 and 10:" if it is empty then exit repeat else if it is random(10) then put "You guessed it!" else put "Sorry, try again." end if end if end repeat /if (single statement) Qon ifDemo answer "Hello" with "Cancel" or "OK" if it is "OK" then beep flash else if it is "Cancel" then beep end ifDemo cif (nested statements) CARDqwJControl structures if (nested statements) 2 of 2 Since each branch of the if structure may contain more than one statement, you must have an end if statement at the end of the structure.`CARDWwJ"Control structures next next repeat The next repeat statement within a repeat structure sends control to the start of the structure. Qrepeat 20 put random(9) into tempVar if tempVar mod 2 = 0 then next repeat put tempVar after field "oddNumbers" end repeat 1 of 1cnextCARDrwJ 13Control structures on 1 of 1 on [] end The on statement marks the start of a message handler. allows a message handler to receive values for the listed parameters from the calling handler. (HyperCard evaluates any items enclosed in parentheses after the handler name in the calling handler and assigns those items as parameter values when the called handler is executed.) /Looking at scripts Message handlers Ps Ps conCARD=swJ 13Control structures pass 1 of 1 pass pass The pass statement ends execution of the handler and sends the message or function call that initiated execution of the handler to the next object in the message-passing order. (Ordinarily, a message or function call stops once it is handled.) /Message handlers The message-passing order cpass`CARD'twJ 3Control structures repeat 1 of 1 repeat end repeat The repeat statement marks the start of a repeat structure, which contains a loop that repeats until an exit statement is reached. Repeat structures have to be contained in a handler. /repeat for repeat forever repeat until repeat while repeat with exit Qon repeatDemo put 1 into Message box repeat add 1 to Message box wait 10 if Message box contains 6 then exit repeat end repeat beep end repeatDemo crepeatCARDuwJ O3Control structures repeat for 1 of 1 repeat [for] [times] end repeat The repeat for form causes the loop to repeat for a specified number of times. If the repeat structure has an exit repeat statement, HyperCard exits the loop and executes the first statement after the end repeat statement. If the structure has a next repeat statement, control goes back to the start of the repeat structure. /repeat repeat until repeat while repeat with exit Qon repeatForDemo put 1 into Message box repeat for 5 add 1 to Message box wait 10 end repeat beep end repeatForDemocrepeat forCARDawJZOControl structures repeat forever repeat [forever] end repeat The repeat forever form causes the loop to repeat continuously. If the repeat structure has an exit repeat statement, HyperCard exits the loop and executes the first statement after the end repeat statement. If the structure has a next repeat statement, control goes back to the start of the repeat structure. Qon repeatForeverDemo put 1 into Message box repeat forever add 1 to Message box if Message box contains 6 then exit repeat end repeat end repeatForeverDemo 1 of 1crepeat forever CARDvwJ 3Control structures repeat until 1 of 1 repeat until end repeat The repeat until form causes the loop to repeat as long as the condition is false. The condition is checked prior to each iteration of the loop. If the repeat structure has an exit repeat statement, HyperCard exits the loop and executes the first statement after the end repeat statement. If the structure has a next repeat statement, control goes back to the start of the repeat structure./repeat repeat for repeat while repeat with exit Qon repeatUntilDemo put 1 into Message box repeat until (Message box contains 6) add 1 to Message box wait 10 end repeat beep end repeatUntilDemo crepeat until CARD}xwJ O3Control structures repeat while 1 of 1 repeat while end repeat The repeat while form causes the loop to repeat as long as the condition is true. The condition is checked prior to each iteration of the loop. If the repeat structure has an exit repeat statement, HyperCard exits the loop and executes the first statement after the end repeat statement. If the structure has a next repeat statement, control goes back to the start of the repeat structure./repeat repeat for repeat until repeat with exit Qon repeatWhileDemo put 1 into Message box repeat while (Message box < 6) add 1 to Message box wait 10 end repeat beep end repeatWhileDemo crepeat whileCARDzwJ 3Control structures repeat with 1 of 2* repeat with = to end repeat repeat with = down to end repeat yields a positive integer equal to the starting value of the variable, and yields a positive integer equal to the ending value of the variable./repeat repeat for repeat until repeat while exit Qon repeatWithDemo repeat with i = 1 to 6 put i into Message box wait 10 end repeat beep repeat with i = 6 down to 1 put i into Message box wait 10 end repeat beep end repeatWithDemo crepeat with`CARD{wJControl structures repeat with 2 of 2 The repeat with form causes the loop to repeat while a variable is not equal to the ending value. The variable is automatically incremented or decremented, depending on the form used. If the repeat structure has an exit repeat statement, HyperCard exits the loop and continues execution at the first statement after the end repeat statement. If the structure has a next repeat statement, control returns to the beginning of the structure and the variable is incremented or decremented.`CARD`|wJ 13Control structures return 1 of 1 return The return statement ends execution of the handler and, in function handlers, returns the value of to the handler that called the function. If a return statement appears in a message handler, it places the value of into the result (a HyperTalk function). The value of the result is only valid immediately after the return statement is executed; each new statement resets the value of the result. /function +If you do not use the return statement in a function handler, the function will always return empty as its value. Qput square (2) into fld 1 --calls square function function square x return x * x --returns 4 to calling statement end squarecreturnCARD ~wJ O13Control structures send 1 of 1 send ]> [to ] send ]> to HyperCard The send statement sends a message directly to the specified object, bypassing any handlers in the message-passing order that might otherwise intercept the message. You can send a message directly to any object in the current stack, to HyperCard itself, or to another stack--but not to a specific object in another stack. +If no object is specified, HyperCard is the object. If the object has no handler for the message, the message is sent along the message passing order, starting from the object to which the message was sent. If the object does have a matching handler, the handler executes. HyperCard stays on the current card even if the receiving object is on another card. Messages sent by executing the statements of the objects handler are sent along the message-passing order starting from the receiving object. Parameter expressions are evaluated before they are sent, even though the entire message has quotation marks around it. Unlike other control structures, you can use send in the Message box to send messages to specific objects. /Message handlers The message-passing order Qsend "hideIt" to field 3 send "addSums travel,food,hotel" to stack "expenseAccount" send "mouseUp" to button "pushMe" send "doMenu print card" to HyperCardcsendCARDFwJ K3O1Commands What is a command? 1 of 1 Commands are messages that cause HyperCard to perform an action. HyperCard responds to commands according to internally defined message handlers. You can redefine a command by intercepting it in the message-passing order before it reaches HyperCard. You can define your own commands by having a handler send a message to another handler later in the message-passing order (or later in the same script). You can also send the message (the same as giving the command) through the Message box./The message-passing order Ps Ps cWhat is a command?CARD3wJ FO13Commands add 1 of 1 add to [ of] or must yield a number. The add command adds the value of to the number in the specified container or chunk and leaves the result of the addition in the container. /subtract Arithmetic operators Qadd 3 to It add field "Amount" to field "Total" on sumField whichField put 0 into total repeat with count = 1 to the number of lines in whichField add line count of whichField to total end repeat put total into msg end sumFieldPs Ps cadd CARDwJ O13Commands answer 1 of 2 answer answer   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  with answer with [or [or ]] answer file [] [of type ] The expressions yield the names of buttons appearing in the answer dialog box. The expression yields one of the following: stack, text, application, or paint (or other file type). The answer command displays as a message in a dialog box containing up to three buttons, each representing a different reply. The last button name you specify is the +A script cannot respond to a dialog box, so its important that a script meant to run unattended not use the answer command. If the question and the replies contain any spaces, put them inside quotation marks (unless youre using container names). Answer automatically sizes the dialog box according to the length of your message, which cannot exceed 255 characters (up to 6 lines)./ask Qanswer "Are you sure?" with "OK" or "Cancel" answer myQuestion with myAnswer or field 7 answer file "Pick a text file:" of type text answer file "" of type paint on answerDemo answer "Which color do you prefer?" with "Red" or "Blue" or "Yellow" if It is "Red" then answer "You picked Red." else if It is "Blue" then answer "You picked Blue." else if It is "Yellow" then answer "You picked Yellow." end if end answerDemo Ps Ps canswerCARDwJ21Commands answer 2 of 2 default button. If you dont specify any button names, the box displays an OK button. The answer dialog box stays on the screen until you click one of the buttons or press Enter or Return. The answer file form displays a standard file dialog box. You can use the of type form to tell HyperCard what type of files to display in the dialog box. You can also supply a prompt by using the expression. The name of the button you click or the file you select is put into the local variable It.Ps Ps @CARDwJO1G3Commands arrowKey (command) 1 of 1* arrowKey The arrowKey command is similar to the Go command, since it allows you to navigate through cards: arrowKey left = go to previous card arrowKey right = go to next card arrowKey up = go forward through recent cards arrowKey down = go backward through recent cards+arrowKey is also a system message sent by HyperCard when you press one of the arrow keys. If the arrowKey message is not intercepted, HyperCard executes the arrowKey command. The textArrows property alters the effect of pressing the arrow keys, but it does not affect the arrowKey command. /arrowKey (system message) Ps Ps carrowKey (command)CARDwJOF13Commands ask 1 of 2* ask [with ] ask password [with ] ask file [with ] The ask command displays as a message in a dialog box along with a text window where you can type an answer. cannot exceed 253 characters. If you use the with text form, appears in the text window as the default answer. The ask password form encrypts the answer as a number. The ask file form allows you to include a prompt for the name of a file and its path. appears as the default. + With the ask password form, you can store the encrypted answer in a field to be compared to a later reply to the ask password command if, for example, you want to protect data that you enter into a stack. Password protection using the ask password command is separate from that set up by the Protect Stack menu command. Unless youre using container names, put the question and the default answer inside quotation marks if they contain any spaces (or if, as in the example script, they are telephone numbers containing a hyphen--to prevent HyperCard from doing subtraction). /answer Qask "Who needs this kind of grief?" with "Not me." ask field 1 with line 1 of field 2 ask password "Please enter your password:" ask file "Save as:" with "Yo" on askDemo ask "Dial what number:" with "555-1212" if It is not empty then dial It end askDemo caskCARDwJ}Commands ask 2 of 2 The ask dialog box stays on the screen until you click one of the buttons or press Enter or Return (which has the same effect as clicking OK). The ask command returns the contents of the text window in the local variable It, unless you click Cancel. In this case, empty is returned in the variable It and Cancel is returned in the result.CARDwJ 8O13Commands beep 1 of 1 beep beep The beep command causes the Apple IIGS to beep. If you specify a positive integer, it beeps that many times. Qbeep 3 beep (number of lines of fld 1) on mouseUp beep 2 -- beep to alert user of dialog answer "Hello" end mouseUp cbeepCARDwJ O13Commands choose 1 of 1 choose tool choose tool The expression yields a number from 1 to 18 that represents a tool. Click Tips to see a table of tool names and their corresponding numbers. The choose command selects a tool from the Tools palette. +1 browse 2 button 3 field 4 select 5 lasso 6 pencil 7 brush 8 eraser 9 line 10 spray tool 11 rectangle 12 round rectangle 13 bucket 14 oval 15 curve 16 text 17 regular polygon 18 polygon Qchoose browse tool choose button tool choose field tool choose eraser tool choose tool 15 choose tool 3 on drawBox set cursor to watch reset paint show card picture choose rectangle tool set lineSize to 2 drag from 10,59 to 100,117 wait 2 second doMenu "Revert" hide cd pict choose browse tool end drawBox cchoose@CARDwJ O13Commands click 1 of 1* click at click at with click at with , click at with , , The expression yields two numbers, separated by a comma, representing vertical and horizontal coordinates. The expressions yield the following key names: shiftKey, optionKey, and commandKey. The click command lets you click the mouse from within your scripts. It sends the same messages as if you had manually clicked the specified location on the screen. +If the style of the field is scrolling, HyperCard will also scroll the text up or down if the pointer is in the scrollbar. You can select a word by double-clicking it (that is, by executing the click command twice in succession at the location of the word). You can select any string of text by clicking at the beginning and then clicking with shiftKey at the end of the string. The pixel offset values of are not restricted to the size of the screen, but are misinterpreted if greater than 32767. /drag Qclick at 100,100 click at the loc of button "Press me" with optionKey --This handler selects and displays a word from a --locked field when you click the word (mouseUp is --not sent to unlocked fields when you click them): on mouseUp set lockText of me to false click at the clickLoc click at the clickLoc get the selection put It into the Message box set lockText of me to true end mouseUpcclick CARDwJ 3Commands close file 1 of 1 close file The close file command closes a disk file previously opened with the open file command. Usually, you open files to import or export ASCII text. Always use the close file command to close files explicitly after you use them. (HyperCard automatically closes all open files when an exit to HyperCard statement is executed, when you press -., or when you quit HyperCard.) /open file cclose file`CARDbwJ 13Commands close printing 1 of 1 close printing The close printing command ends a print job previously begun with the open printing command./open printing Q--The following example handler executes a --printing job, printing a specified number of --cards, beginning on a specified card: on printRange low,high push card open printing go to card low print (high-low) + 1 cards close printing pop card end printRange+Dont use the open printing and close printing commands when you want to be able to print cards in a locked stack that show any objects that are normally hidden (for example, a field that shows when you click a button). Instead, have your handler go to each card and use the print card command. cclose printingCARDєwJ O13Commands controlKey (command) 1 of 1 controlKey yields a number from 0 to 255 thats generated by a keystroke on the Apple IIGS keyboard. Click Tips to see a table of keystrokes and their corresponding numbers. The controlKey command passes , which represents a key pressed in combination with the Control key.+Because controlKey is also a system message sent to the current card, you need to intercept the message with a handler somewhere in the message-passing order between the current card and HyperCard. Key pressed with Number passed: Control key: 2 (Keyboard) 0 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h, Left Arrow 8 i, Tab 9 j, Down Arrow 10 k, Up Arrow 11 l 12 m, Enter, Return 13 n 14 o 15 p 16 q 17 r 18 s 19 t 20 u, Right Arrow 21 v 22 w 23 x, Clear 24 y 25 z 26 Esc, [ 27 \ 28 ] 29 6 (Keyboard) 30 Hyphen (-) 31 Single quotation Mark (') 39 Asterisk (*) 42 Plus (+) 43 Comma (,) 44 Minus (-) 45 Period (.) 46 Slash (/) 47 0 48 1 49 2 (Keypad) 50 3 51 4 52 5 53 6 (Keypad) 54 7 55 8 56 9 57 Semicolon (;) 59 Equal (=) 61 Tilde (~) 96 Function Keys 1 122 2 120 3 99 4 118 5 96 6 97 7 98 8 100 9 101 10 109 11 103 12 111 13 105 14 107 15 113 Forward Delete 117 Delete 127/controlKey (system message) Q-- The following handler uses the controlKey -- command to print the current card with the -- Control-P key combination on controlKey whichKey if whichKey = 16 then doMenu "Print Card" exit controlKey end if pass controlKey end controlKeyccontrolKey (command)CARDEwJ IO31Commands convert 1 of 1 convert [ of] to convert [ of] to and The convert command changes a date or time in the specified container or chunk to the format specified by . You can use the second form to convert both a date and a time together. Click Tips to see a list of formats. +Format conversions (for 10/23/89, 12:57 PM) long date Monday, October 23, 1989 abbrev date Mon, Oct 23, 1989 short date 10/23/89 long time 12:57:00 PM short time 12:57 PM abbrev time 12:57 PM seconds 2707995420 (Seconds since midnight, January 1, 1904) dateItems 1989,10,23,12,57,0,2 (A list of numbers representing the year, month, day, hour, minute, second, and day of week) Q--This handler counts the seconds elapsed while a --command in the Message box executes: on mouseUp put the long time into startTime convert startTime to seconds if the message box is not empty then do msg put the long time into endTime convert endTime to seconds answer "That took" && endTime - startTime && "seconds." end mouseUp on convertDemo put empty into theText put the date into theDate ask "Enter your birthday (M/D/Y):" if it is empty then exit convertDemo convert it to seconds convert theDate to seconds put (theDate - it)/ (60 * 60 * 24) into N put N div 365 into y put (N mod 365) div 7 into w put ((N mod 365) mod 7) into d answer "It has been" && N && "days since your birthday. You are" && y && "years," && w && "weeks, and" && d && "days old." end convertDemoPs Ps cconvertCARDwJOCommands create stack create stack [with ] The expression yields a valid background descriptor. The create stack command creates a new stack with a specified name and optionally with any specified background. If you do not specify a background, the stack is created with a blank background. Qcreate stack "Ghosts" with this background create stack "Hay" with bkgnd id 1788 1 of 1ccreate stackCARDwJ O31Commands delete 1 of 1 delete [of ] The delete command allows you to remove text from a container. +Using the delete command is not the same as using put empty into the same chunk of text specified. For example, if you delete a line in a field with a statement like delete line 4 of field 7 you delete the return character as well as the text; what was previously the fifth line becomes the fourth. The following statement leaves the return character in line 4: put empty into line 4 of field 7 Delete does not remove the field itself. If you delete all of the text in a field, the field remains defined on the card or background. To delete the field, select it (using the select command) and then call doMenu "Cut Field" or doMenu "Clear Field". When you delete text in a field on a card other than the current one, the current card does not change. Qdelete line 1 of field 1 delete char 1 to 5 of line 4 of field "Charlie" of second card on zapaName put "Spragens" & return & "Kamins" & return & "Bond" into list answer "Delete which name from the list?" & return & list with "1" or "2" or "3" delete line it of list answer "The new list is:" & return & list end zapaName Ps Ps cdeleteCARD=tyJQCommands delete stack delete [stack] The delete stack command deletes the specified stack. (You cannot delete the Home stack using the delete stack command.) No dialog box appears asking you to confirm the delete command. 1 of 1Qdelete stack ":HardDisk:Inventory:Plates" delete ":myDisk:myFolder:myStack"cdelete stack CARDtyJ O31Commands dial 1 of 1 dial dial with modem [] The dial command by itself generates touch-tone sounds through the Apple IIGS speaker. For HyperCard to dial the phone, you must hold the handset up to the speaker, or use a device that feeds Apple IIGS audio output to the telephone. The with modem form sets up calls using the Apple Modem 300/1200, the Apple Personal Modem, or any Hayes-compatible modem attached to the serial port. See your modem manual for valid . +If yields a number that includes a hyphen (as in 555-1212), you must place quotation marks around the number to prevent HyperCard from first performing subtraction (because HyperCard understands the hyphen as a minus sign). To HyperCard, the command dial 555- 1212 becomes dial -667 Type dial "555-1212" instead. The form dial with modem is equivalent to dial with modem "ATS0=0DT" Qdial "415-555-1212" dial "407-996-1010" with modem "ATS0=0S7=1DT" dial "407-973-6000" with modem -- if charlie is a variable containing a number: dial charlie Ps Ps cdialCARDtyJ yO13Commands divide 1 of 1 divide [ of] by The divide command divides the number in the container or chunk by and puts the result into the container. The container or chunk referred to must contain a number. Dividing by 0 places INF (for infinity) into the chunk or container. Division is carried out to 19 decimal places./numberFormat multiply Arithmetic operators Qdivide field "total" by 3 -- if farenheit and celsius are variables: divide farenheit by celsius on percent ask "Enter the first number:" if it is empty then exit percent put it into num1a put it into num1b ask "Enter the second number:" if it is empty then exit percent put it into num2 divide num1a by num2 --result is in num1a answer num1b && "is" && trunc(num1a * 100) & "%" && "of" && num2 end percent Ps Ps cdivideCARDtyJ O13Commands doMenu (command) 1 of 1 doMenu The doMenu command performs the menu command specified by the expression as though you had chosen the item manually from a HyperCard menu. +Both the specified command and the menu in which it resides must be available at the current user level. If there are periods following the menu command, you must include them in menuItem (you cant use the ellipsis character in their place). Some menu commands change with conditions (for example, Paste Card can change to Paste Button, depending on the contents of the Clipboard). Dont lock yourself out: If you write a handler to intercept doMenu, be sure to pass the message. Otherwise, you may find yourself apparently unable to use any menu command, even to fix the doMenu handler or to quit HyperCard. In that case, you can still access the script containing the doMenu handler by keyboard shortcuts. /doMenu (system message) QdoMenu "open stack..." doMenu thisCommand -- thisCommand is a variable -- containing a menu command doMenu "Control Panel"Ps Ps cdoMenu (command)`CARDΞtyJ O13Commands drag 1 of 1 drag from to drag from to with drag from to with , drag from to with , , The expressions yield the coordinates of the beginning and end locations of the drag. The expressions yield the key names shiftKey, optionKey, and commandKey. The drag command has the same effect as dragging manually, except that you have to use the Shift key to select text in a field. Using the with form has the same result as dragging while holding down the specified key. +You can use drag with any tool selected, but it has no effect with some Paint tools. The location of the actual pointer doesnt change from where it was before the command was issued. /dragSpeed Qdrag from 100,100 to 180,180 drag from the loc of button 1 to the mouseLoc with commandKey, shiftKey on dragDemo choose oval tool show card picture set filled to true answer "Click to stop the drawing." repeat until the mouseclick set pattern to random(32) drag from random(320),random(200) to random(320),random(200) end repeat wait 1 second doMenu "Revert" choose browse tool hide card picture end dragDemo cdrag CARD~tyJ O31Commands edit script 1 of 1 edit script of The edit script command opens the script of the specified object with the HyperCard script editor as though you had clicked the Script button in the objects Info dialog box. If the edit script command is issued from a script, execution of the current handler is suspended until the script editor dialog box is closed.Qedit script of button 1 edit script of this stack --The following example handler enables you to edit --the script of any button or field by positioning the --pointer over it and pressing the Option key: on mouseWithin if the optionKey is down then edit script of the target end mouseWithincedit script`CARDtyJ 13Commands enterKey (command) 1 of 1 enterKey The enterKey command sends the contents of the Message box to the current card unless a field is open for text editing; in that case, enterKey closes the field. The enterKey message, which invokes the enterKey command if it reaches HyperCard, is normally sent by pressing the Enter key on the keyboard, but you can send it from within a handler using this command. /enterKey (system message) enterInField Ps Ps centerKey (command)@CARDtyJ OCommands export paint export paint to file The expression yields a valid Apple IIGS file name. The export paint command creates an Apple IIGS paint file containing the image of the current card or background and saves it with the specified file name. Qexport paint to file Biz.Card 1 of 1+If an error occurs while the export paint command is being executed, the error is stored in the result (a HyperTalk function)./import paint cexport paint CARD>tyJ/ OG13Commands find 1 of 3 find [in ] find chars [in ] find word [in ] find whole [in ] find string [in ] The find command searches for a text string in all the card and background fields (visible or not) of the current stack. If you use the in field option, you can restrict the search to a particular background field. (You cannot restrict the search to a particular card field.) +The search begins on the current card and continues through the last card of the stack, to the first card, and on to the card previous to the current card. Choosing Find from the Edit menu (or pressing -F) puts the find command in the Message box, followed by the text insertion point between double quotation marks. Use at least three characters: The find command executes faster if you use as many three-character combinations as possible in the search string. That is, three characters are fast, six are faster than three, nine are faster than six, and so on. The Find command disregards case and diacritical marks when looking for matches: apple Cmpter, apple computr, and Apple Computer are all seen as the same. /foundChunk foundField foundLine foundText Qfind chars "Wild" in field 1 find word "Yeti" in second field --using find whole to find phrases find whole "lets you search for a specific" find whole "Kevin Knabe" in field "name" find whole currentFindVar find whole fld "title" in fld "index" --using find string find string "ets you search for a spec" find string lastName find string char 1 to 4 of the short name of this card --The following example handler queries the --user for search criteria, then executes the --find command: on doMenu whichCommand global findString if whichCommand is "Find..." then ask "Find what string:" with findString if it is empty then exit doMenu put it into findString answer "Match" && findString && "how:" with "Chars" or "Word" or "All" if it is "Chars" then find chars findString else if it is "Word" then find word findString else find findString end if else pass doMenu end doMenu on findDemo --First, find a contiguous string of --characters, including spaces, that breaks --word boundaries: find string "ind a contig" in background field "Demo Script" wait 4 seconds --Next, find a phrase: find whole "find a phrase" in bg fld "Demo Script" wait 4 seconds end findDemo Ps Ps cfindCARDEtyJ[Commands find 2 of 3 Find, find chars, and find word treat each word of the search string as a separate search. For example, find "this command" is treated as find "this" and find "command". The search succeeds if HyperCard finds all the words of the search string anywhere on the card (or in the specified field). That is, the words do not have to be in order. Find whole and find string treat spaces as part of the search string. For example, find whole "this command" only succeeds if HyperCard finds that exact string, including the space. That is, the words must appear in order. @CARDݦtyJCommands find 3 of 3 When the find command succeeds, HyperCard places a box around the found text (or parts of it) and sets the result function to empty. When find fails, HyperCard sets the result function to the string "not found". CARDϪtyJ 6O13Commands functionKey (command) 1 of 1 functionKey The expression yields a number from 1 to 15 that corresponds to one of the function keys (the top row of keys on the Apple Extended Keyboard). The function keys from 1 to 4 are already programmed for Undo, Cut, Copy, and Paste, respectively./functionKey (system message) QfunctionKey 1 functionKey 15 --The following example handler uses the --functionKey command to implement the message --undo as a command: on undo functionKey 1 end undocfunctionKey (command)CARDtyJ ^O13Commands get 1 of 1 get The get command puts the value of into the local variable It. That is, get is the same as put into It/put Qget the long name of field 1 get the location of button "newButton" get 2+3 -- puts 5 into It get the datecget`CARDAtyJ #1Commands go 1 of 1 go [to] go [to] [of ] go [to] [of ] [of ] The go command always takes you to a card. If you name a stack (or background) without specifying a card, you go to the first card of the stack (or background). You can specify a visual effect to be used when the card is opened by using the visual effect command before you use the go command.Q--go to a different stack: go stack "Address" go "Address" go to background 1 of stack "Address" go card 4 of background 1 of stack "Address" --use full pathname: go ":hd:bigFolder:innerFolder:myStack" --go to a different background: go background 1 go background id 23039 go next background --go to a different card: go card 4 go card id 23405 go first card go next card --go to a new stack, but skip the dialog if -- the stack is not found: go to stack "Home" without dialog go to bkgnd 2 of stack "Address" without dialog go card 1 of bg 2 of stack "Address" without dialog on randomDemo --go to a random card and return: set cursor to watch send "mouseUp" to bg btn "OK" push card visual effect dissolve to black go any card in this background wait 1 second pop card send "mouseUp" to bg btn "Demo Script" end randomDemo /visual cgoCARDtyJ 13Commands help (command) 1 of 1 help The help command takes you to the first card of the stack named HyperCard Help. /help (system message) chelp (command) CARDtyJ O13Commands hide (command) 1 of 1 hide menuBar hide hide