home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / chemistr / thermoch.sit / thermo / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1992-08-17  |  8.0 KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>104</cardCount>
  7.     <cardID>3774</cardID>
  8.     <listID>38476</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on idle
  17. global MOUSE_TRACKER, IDLE_TIMER, MAX_IDLE_TIME, DIVIDING_LINE
  18. global GLOSSARY_FLAG
  19. get the mouseloc
  20. if the optionkey is down then
  21. visual effect dissolve to black
  22. visual effect dissolve
  23. go to card "main menu"
  24. exit to hypercard
  25. end if
  26. put inkey() into TEMP
  27. if MOUSE_TRACKER = the mouseloc then
  28. get the seconds
  29. subtract IDLE_TIMER from it
  30. if it > MAX_IDLE_TIME then
  31. promptoid "Please move the mouse"
  32. put the ticks into START_TIME
  33. repeat while the ticks - START_TIME < 300
  34. if the mouseloc <> MOUSE_TRACKER then
  35. put the seconds into IDLE_TIMER
  36. put the mouseloc into MOUSE_TRACKER
  37. close window "promptoid"
  38. exit idle
  39. end if
  40. end repeat
  41. close window "promptoid"
  42. put the seconds into IDLE_TIMER
  43. put the mouseloc into MOUSE_TRACKER
  44. visual effect dissolve to black
  45. visual effect dissolve
  46. go to card "main menu"
  47. exit to hypercard
  48. end if
  49. else
  50. put the seconds into IDLE_TIMER
  51. put the mouseloc into MOUSE_TRACKER
  52. end if
  53.  
  54. end idle
  55.  
  56. on ClickWait
  57. global MAX_IDLE_TIME
  58.  
  59. put empty into TOTAL_WAIT_TIME
  60. put MAX_IDLE_TIME * 60 into MAX_WAIT_TIME
  61. put the mouseloc into MOUSE_TRACKER
  62.  
  63. repeat while the mouseclick is true
  64. -- Clean out leftover mouseclicks
  65. end repeat
  66.  
  67. set cursor to "face 1"
  68. put 1 into CURRENT_FACE
  69. repeat
  70. if the optionkey is "down" then
  71. visual effect dissolve to black
  72. visual effect dissolve
  73. go to card "main menu"
  74. exit to hypercard
  75. else
  76. if the mouseclick then exit repeat
  77. end if
  78. if inkey() is " " then exit repeat
  79. put the random of 20 into WAIT_TEMP
  80. add 50 to WAIT_TEMP
  81. wait WAIT_TEMP
  82. add WAIT_TEMP to TOTAL_WAIT_TIME
  83. if TOTAL_WAIT_TIME > MAX_WAIT_TIME then
  84. if the mouseloc = MOUSE_TRACKER then
  85. promptoid "Please move the mouse"
  86. put the ticks into START_TIME
  87. put FALSE into FALSE_ALARM
  88. repeat while the ticks - START_TIME < 300
  89. if the mouseloc <> MOUSE_TRACKER then
  90. put TRUE into FALSE_ALARM
  91. exit repeat
  92. end if
  93. end repeat
  94. close window "promptoid"
  95. if FALSE_ALARM then
  96. put the mouseloc into MOUSE_TRACKER
  97. put 0 into TOTAL_WAIT_TIME
  98. else
  99. visual effect dissolve to black
  100. visual effect dissolve
  101. go to card "main menu"
  102. exit to hypercard
  103. end if
  104. else
  105. put the mouseloc into MOUSE_TRACKER
  106. put 0 into TOTAL_WAIT_TIME
  107. end if
  108. end if
  109. if CURRENT_FACE is 1 then
  110. put the random of 20 into CURRENT_FACE
  111. put "face " & CURRENT_FACE into NEW_FACE
  112. set cursor to NEW_FACE
  113. else if CURRENT_FACE is 2 then
  114. set cursor to "face 1"
  115. put 1 into CURRENT_FACE
  116. else
  117. put the random of 20 into CURRENT_FACE
  118. if CURRENT_FACE is 2 then put 1 into CURRENT_FACE
  119. put "face " & CURRENT_FACE into NEW_FACE
  120. set cursor to NEW_FACE
  121. end if
  122. end repeat
  123. set cursor to none
  124.  
  125. end ClickWait
  126.  
  127. on openstack
  128. global USERLEVEL_SAVE
  129. global WAIT_INTERVAL
  130. global MYVOLUME
  131. global VOLUME_SAVE
  132. global EFFECT_SPEED
  133. global SPEED
  134. global LOG_FLAG
  135. global MAX_IDLE_TIME
  136. global IDLE_TIMER
  137. global MOUSE_TRACKER
  138. global DIVIDING_LINE
  139. global GLOSSARY_FLAG
  140.  
  141. hide menubar
  142. hide titlebar
  143. put FALSE into GLOSSARY_FLAG
  144. put the screenrect into SCREEN_BORDER
  145. put the rect of card window into CARD_BORDER
  146. put item 3 of SCREEN_BORDER - item 1 of SCREEN_BORDER into SCREEN_WIDTH
  147. put item 4 of SCREEN_BORDER - item 2 of SCREEN_BORDER into SCREEN_HEIGHT
  148. put item 3 of CARD_BORDER - item 1 of CARD_BORDER into CARD_WIDTH
  149. put item 4 of CARD_BORDER - item 2 of CARD_BORDER into CARD_HEIGHT
  150. put (SCREEN_WIDTH - CARD_WIDTH) / 2 into item 1 of TOP_LEFT
  151. put (SCREEN_HEIGHT - CARD_HEIGHT) / 2 into item 2 of TOP_LEFT
  152. set the loc of card window to TOP_LEFT
  153. set the cantmodify of this stack to true
  154. set the cantpeek of this stack to true
  155. set the blindtyping to false
  156. put the userlevel into USERLEVEL_SAVE
  157. put 60 into WAIT_INTERVAL
  158. set the userlevel to 2
  159. put volume(4) into VOLUME_SAVE
  160. put 4 into MYVOLUME
  161. send updatevolume to card button "slider 1" of card "controls"
  162. put EMPTY into LOG_FLAG
  163. put 120 into MAX_IDLE_TIME
  164. put 0 into IDLE_TIMER
  165. put the mouseloc into MOUSE_TRACKER
  166. get the rect of the card window
  167. put ( item 3 of it - item 1 of it ) / 2 into DIVIDING_LINE
  168. put the short name of this stack into TEMP
  169. put " glossary" after TEMP
  170. if there is a window TEMP then
  171. start using stack TEMP
  172. else
  173. if there is a stack TEMP then
  174. push card
  175. set the lockmessages to true
  176. go to stack TEMP in a new window
  177. glossaryInit
  178. pop card
  179. set the lockmessages to FALSE
  180. end if
  181. end if
  182.  
  183. end openstack
  184.  
  185. on closestack
  186. global USERLEVEL_SAVE
  187. global VOLUME_SAVE
  188.  
  189. set the userlevel to USERLEVEL_SAVE
  190. put volume(VOLUME_SAVE) into TEMP
  191.  
  192. end closestack
  193.  
  194. on suspendstack
  195. global USERLEVEL_SAVE
  196. global VOLUME_SAVE
  197.  
  198. put the userlevel into TEMP
  199. set the userlevel to USERLEVEL_SAVE
  200. put TEMP into USERLEVEL_SAVE
  201. put volume(VOLUME_SAVE) into VOLUME_SAVE
  202.  
  203. end suspendstack
  204.  
  205. on resumestack
  206. global USERLEVEL_SAVE
  207. global VOLUME_SAVE
  208.  
  209. put the userlevel into TEMP
  210. set the userlevel to USERLEVEL_SAVE
  211. put TEMP into USERLEVEL_SAVE
  212. put volume(VOLUME_SAVE) into VOLUME_SAVE
  213.  
  214. end resumestack
  215.  
  216. on work
  217. set the userlevel to 5
  218. set the cantmodify of this stack to false
  219. set the cantpeek of this stack to false
  220. end work
  221.  
  222. on use
  223. set the cantmodify of this stack to true
  224. set the cantpeek of this stack to true
  225. end use
  226.  
  227. on record_answer MODULE, QUESTION, RIGHTWRONG
  228. end record_answer
  229.  
  230. function significantto WORK,PLACES
  231.  
  232. repeat while first char of WORK is "0"
  233. delete first char of WORK
  234. if WORK is EMPTY then
  235. return FALSE
  236. exit significantto
  237. end if
  238. end repeat
  239.  
  240. put offset( ".", WORK ) into DECIMAL
  241.  
  242. if DECIMAL > 1 then
  243. if length( WORK ) = PLACES + 1 then
  244. return TRUE
  245. else
  246. return FALSE
  247. end if
  248. else
  249. repeat while char DECIMAL+1 of work is "0"
  250. add 1 to DECIMAL
  251. end repeat
  252. if (length( WORK ) - DECIMAL) = PLACES then
  253. return TRUE
  254. else
  255. return FALSE
  256. end if
  257. end if
  258.  
  259. end significantto
  260.  
  261. function numberVerify container
  262. put the charToNum of "0" into base
  263. put the charToNum of "." into aperiod
  264. put the charToNum of " " into ablank
  265. put the charToNum of "-" into aminus
  266. put 0 into isanumber
  267. put false into seenAPeriod
  268. put false into numberStarted
  269. put false into numberFinished
  270. put false into seenASign
  271. repeat with i = 1 to the number of characters in line 1 of container
  272. put (the charToNum of char i of container) into test
  273. if test is aperiod then
  274. if numberFinished or seenAperiod then
  275. put i into isanumber
  276. exit repeat
  277. else
  278. put true into seenAPeriod
  279. put true into numberStarted
  280. end if
  281. else if test is aminus then
  282. if numberStarted or seenASign then
  283. put i into isanumber
  284. exit repeat
  285. else
  286. put true into seenASign
  287. put true into numberStarted
  288. end if
  289. else if test is ablank and numberStarted and not numberFinished then
  290. put true into numberFinished
  291. else if test is not ablank then
  292. if numberFinished then
  293. put i into isanumber
  294. exit repeat
  295. else if ((test-base) < 0) or ((test-base) > 9) then
  296. put i into isanumber
  297. exit repeat
  298. else
  299. put true into numberStarted
  300. end if
  301. end if
  302. end repeat
  303. return isanumber
  304. end numberVerify
  305.  
  306. on login
  307.  
  308. open file "Hyperchem Records"
  309. read from file "Hyperchem Records" for 16384
  310. repeat until it is EMPTY
  311. put it into PAST_ENTRIES
  312. read from file "Hyperchem Records" for 16384
  313. end repeat
  314. put EMPTY into USERNAME
  315. if USERNAME is empty then
  316. ask "Please type your name or ID number:"
  317. repeat while it is empty
  318. ask "Please type your name or ID number:"
  319. end repeat
  320. put it into USERNAME
  321. end if
  322. put USERNAME & "," & the short name of this stack & "," &┬¼
  323. the time & "," & the date & RETURN into THIS_ENTRY
  324. write THIS_ENTRY to file "Hyperchem Records"
  325. close file "Hyperchem Records"
  326.  
  327. end login
  328.  
  329. on doright
  330. push card
  331. visual effect checkerboard
  332. go to card "CORRECT"
  333. wait 45
  334. pop card
  335. end doright
  336.  
  337. on dowrong
  338. push card
  339. visual effect checkerboard
  340. go to card "wrong"
  341. wait 45
  342. pop card
  343. end dowrong
  344.  
  345. on dorightalt
  346. push card
  347. visual effect checkerboard
  348. go to card "CORRECT"
  349. wait 45
  350. pop card
  351. end dorightalt
  352.  
  353. on doglossary
  354.  
  355. push card
  356. lock screen
  357. put the short name of this stack into TEMP
  358. go to stack TEMP & " glossary" in new window
  359. if card field "glossary" is empty then
  360. answer "No glossary entrie