home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / tshirts.sit / T-Shirts / card_12246.txt < prev    next >
Text File  |  1990-09-13  |  10KB  |  439 lines

  1. -- card: 12246 from stack: in
  2. -- bmap block id: 12396
  3. -- flags: 0000
  4. -- background id: 6796
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on opencard
  8.   repeat with i = 3 to 9
  9.     get field 3 of card i
  10.     put it into card field i
  11.   end repeat
  12. end opencard
  13.  
  14. on closecard
  15.   repeat with i = 3 to 9
  16.     get card field i
  17.     put it into field 3 of card i
  18.   end repeat
  19. end closecard
  20.  
  21.  
  22.  
  23. -- part 1 (button)
  24. -- low flags: 00
  25. -- high flags: 0000
  26. -- rect: left=479 top=315 right=342 bottom=511
  27. -- title width / last selected line: 0
  28. -- icon id / first selected line: 1012 / 1012
  29. -- text alignment: 1
  30. -- font id: 0
  31. -- text size: 12
  32. -- style flags: 0
  33. -- line height: 16
  34. -- part name: Return
  35. ----- HyperTalk script -----
  36. on mouseUp
  37.   visual effect iris close
  38.   pop card
  39. end mouseUp
  40.  
  41.  
  42.  
  43. -- part 5 (field)
  44. -- low flags: 00
  45. -- high flags: 4000
  46. -- rect: left=16 top=235 right=320 bottom=269
  47. -- title width / last selected line: 0
  48. -- icon id / first selected line: 0 / 0
  49. -- text alignment: 0
  50. -- font id: 3
  51. -- text size: 12
  52. -- style flags: 0
  53. -- line height: 16
  54. -- part name: maddr
  55.  
  56.  
  57. -- part 6 (field)
  58. -- low flags: 00
  59. -- high flags: 0000
  60. -- rect: left=80 top=188 right=205 bottom=108
  61. -- title width / last selected line: 0
  62. -- icon id / first selected line: 0 / 0
  63. -- text alignment: 1
  64. -- font id: 3
  65. -- text size: 12
  66. -- style flags: 0
  67. -- line height: 16
  68. -- part name: ShirtSize
  69.  
  70.  
  71. -- part 7 (button)
  72. -- low flags: 00
  73. -- high flags: A003
  74. -- rect: left=370 top=259 right=283 bottom=482
  75. -- title width / last selected line: 0
  76. -- icon id / first selected line: 0 / 0
  77. -- text alignment: 1
  78. -- font id: 0
  79. -- text size: 12
  80. -- style flags: 0
  81. -- line height: 16
  82. -- part name: Print Order
  83. ----- HyperTalk script -----
  84. function checkquant
  85. repeat with i = 3 to 9
  86.   repeat with j = 1 to the length of card field i
  87.     get character j of card field i
  88.     if (it<"0") or (it>"9") then
  89.       if (it=".") then
  90.         answer "Quantity must be an integer"
  91.         select text of card field i
  92.         return false
  93.         exit checkquant
  94.       else if (it="-") then
  95.         answer "Quantity must be positive"
  96.         select text of card field i
  97.         return false
  98.         exit checkquant
  99.       else if (it="O") then   -- the letter "O"
  100.         put "0" into character j of card field i
  101.       else if (it="l") then   -- the letter "L"
  102.         put "1" into character j of card field i
  103.       else
  104.         answer "Quantity must be a number"
  105.         select text of card field i
  106.         return false
  107.         exit checkquant
  108.       end if
  109.     end if
  110.   end repeat
  111. end repeat
  112. return true
  113. end checkquant
  114.  
  115. function checksize
  116. get card field ShirtSize
  117. if it="" then
  118.   answer "Please enter the size"
  119.   select text of card field 2
  120.   return false
  121. else if not ((it is "S") or (it is "s") or (it is "M") or (it is "m") or (it is "L") or (it is "L") or (it is "XL") or (it is "xl")) then
  122.   answer "Size must be S,M,L,or XL"
  123.   select text of card field 2
  124.   return false
  125. else
  126.   return true
  127. end if
  128. end checksize
  129.  
  130. function checkaddr
  131. get card field maddr
  132. if it="" then
  133.   answer "Please enter mailing address"
  134.   select text of card field maddr
  135.   return false
  136. else
  137.   return true
  138. end if
  139. end checkaddr
  140.  
  141. on copy2nextcard
  142.   put card field maddr into card field maddr of next card
  143.   put card field maddr into card field cmaddr of next card
  144.   put card field ShirtSize into card field ShirtSize of next card
  145.   put card field ShirtSize into card field CShirtSize of next card
  146.   put card field usrcomment into card field usrcomment of next card
  147.   repeat with i = 3 to 9
  148.     get card field i
  149.     put it into card field i of next card
  150.     put it into card field (i+10) of next card
  151.   end repeat
  152. end copy2nextcard
  153.  
  154. on calccost
  155.   put "--" into card field cost
  156.   put "--" into card field stax
  157.   put "--" into card field shipc
  158.   put "--" into card field totc
  159.   put 0 into card field totq
  160.   repeat with i = 3 to 9
  161.     put (card field totq +card field i) into card field totq
  162.   end repeat
  163.   if card field totq=0 then
  164.   else
  165.     put (card field totq)*12+2 into card field cost
  166.     put card field cost into card field totc
  167.     if hilite of card button inny of previous card then
  168.       put 0.07 * card field totc into card field stax
  169.       put card field stax + card field totc into card field totc
  170.       put "$" &  card field stax into card field stax
  171.     end if
  172.     put 3.75 into card field shipc
  173.     put card field shipc + card field totc into card field totc
  174.     put "$" &  card field cost & ".00" into card field cost
  175.     put "$" &  card field shipc into card field shipc
  176.     put "$" &  card field totc into card field totc
  177.   end if
  178. end calccost
  179.  
  180. on mouseUp
  181.   if checkquant() then
  182.     if checksize() then
  183.       if checkaddr() then
  184.         copy2nextcard
  185.         go to next card
  186.         calccost
  187.         if card field totq=0 then
  188.           answer "You haven't ordered anything!"
  189.         else
  190.           print card
  191.         end if
  192.         go to previous card
  193.       end if
  194.     end if
  195.   end if
  196. end mouseUp
  197.  
  198.  
  199.  
  200. -- part 9 (field)
  201. -- low flags: 00
  202. -- high flags: 0000
  203. -- rect: left=59 top=51 right=68 bottom=88
  204. -- title width / last selected line: 0
  205. -- icon id / first selected line: 0 / 0
  206. -- text alignment: 1
  207. -- font id: 3
  208. -- text size: 12
  209. -- style flags: 0
  210. -- line height: 16
  211. -- part name: 
  212.  
  213.  
  214. -- part 10 (field)
  215. -- low flags: 00
  216. -- high flags: 0000
  217. -- rect: left=59 top=69 right=86 bottom=88
  218. -- title width / last selected line: 0
  219. -- icon id / first selected line: 0 / 0
  220. -- text alignment: 1
  221. -- font id: 3
  222. -- text size: 12
  223. -- style flags: 0
  224. -- line height: 16
  225. -- part name: 
  226.  
  227.  
  228. -- part 11 (field)
  229. -- low flags: 00
  230. -- high flags: 0000
  231. -- rect: left=59 top=87 right=104 bottom=88
  232. -- title width / last selected line: 0
  233. -- icon id / first selected line: 0 / 0
  234. -- text alignment: 1
  235. -- font id: 3
  236. -- text size: 12
  237. -- style flags: 0
  238. -- line height: 16
  239. -- part name: 
  240.  
  241.  
  242. -- part 12 (field)
  243. -- low flags: 00
  244. -- high flags: 0000
  245. -- rect: left=59 top=105 right=122 bottom=88
  246. -- title width / last selected line: 0
  247. -- icon id / first selected line: 0 / 0
  248. -- text alignment: 1
  249. -- font id: 3
  250. -- text size: 12
  251. -- style flags: 0
  252. -- line height: 16
  253. -- part name: 
  254.  
  255.  
  256. -- part 13 (field)
  257. -- low flags: 00
  258. -- high flags: 0000
  259. -- rect: left=59 top=123 right=140 bottom=88
  260. -- title width / last selected line: 0
  261. -- icon id / first selected line: 0 / 0
  262. -- text alignment: 1
  263. -- font id: 3
  264. -- text size: 12
  265. -- style flags: 0
  266. -- line height: 16
  267. -- part name: 
  268.  
  269.  
  270. -- part 14 (field)
  271. -- low flags: 00
  272. -- high flags: 0000
  273. -- rect: left=59 top=141 right=158 bottom=88
  274. -- title width / last selected line: 0
  275. -- icon id / first selected line: 0 / 0
  276. -- text alignment: 1
  277. -- font id: 3
  278. -- text size: 12
  279. -- style flags: 0
  280. -- line height: 16
  281. -- part name: 
  282.  
  283.  
  284. -- part 15 (field)
  285. -- low flags: 00
  286. -- high flags: 0000
  287. -- rect: left=59 top=159 right=176 bottom=88
  288. -- title width / last selected line: 0
  289. -- icon id / first selected line: 0 / 0
  290. -- text alignment: 1
  291. -- font id: 3
  292. -- text size: 12
  293. -- style flags: 0
  294. -- line height: 16
  295. -- part name: 
  296.  
  297.  
  298. -- part 27 (field)
  299. -- low flags: 00
  300. -- high flags: 4000
  301. -- rect: left=320 top=54 right=217 bottom=498
  302. -- title width / last selected line: 0
  303. -- icon id / first selected line: 0 / 0
  304. -- text alignment: 0
  305. -- font id: 3
  306. -- text size: 12
  307. -- style flags: 0
  308. -- line height: 16
  309. -- part name: usrcomment
  310.  
  311.  
  312. -- part 29 (button)
  313. -- low flags: 00
  314. -- high flags: A003
  315. -- rect: left=127 top=186 right=208 bottom=150
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 0 / 0
  318. -- text alignment: 1
  319. -- font id: 0
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: S
  324. ----- HyperTalk script -----
  325. on mouseUp
  326.   put "S" into card field shirtsize
  327. end mouseUp
  328.  
  329.  
  330.  
  331. -- part 30 (button)
  332. -- low flags: 00
  333. -- high flags: A003
  334. -- rect: left=157 top=186 right=208 bottom=180
  335. -- title width / last selected line: 0
  336. -- icon id / first selected line: 0 / 0
  337. -- text alignment: 1
  338. -- font id: 0
  339. -- text size: 12
  340. -- style flags: 0
  341. -- line height: 16
  342. -- part name: M
  343. ----- HyperTalk script -----
  344. on mouseUp
  345.   put "M" into card field shirtsize
  346. end mouseUp
  347.  
  348.  
  349.  
  350. -- part 31 (button)
  351. -- low flags: 00
  352. -- high flags: A003
  353. -- rect: left=185 top=186 right=208 bottom=208
  354. -- title width / last selected line: 0
  355. -- icon id / first selected line: 0 / 0
  356. -- text alignment: 1
  357. -- font id: 0
  358. -- text size: 12
  359. -- style flags: 0
  360. -- line height: 16
  361. -- part name: L
  362. ----- HyperTalk script -----
  363. on mouseUp
  364.   put "L" into card field shirtsize
  365. end mouseUp
  366.  
  367.  
  368.  
  369. -- part 32 (button)
  370. -- low flags: 00
  371. -- high flags: A003
  372. -- rect: left=228 top=186 right=208 bottom=251
  373. -- title width / last selected line: 0
  374. -- icon id / first selected line: 0 / 0
  375. -- text alignment: 1
  376. -- font id: 0
  377. -- text size: 12
  378. -- style flags: 0
  379. -- line height: 16
  380. -- part name: XL
  381. ----- HyperTalk script -----
  382. on mouseUp
  383.   put "XL" into card field shirtsize
  384. end mouseUp
  385.  
  386.  
  387.  
  388. -- part 33 (field)
  389. -- low flags: 01
  390. -- high flags: 0000
  391. -- rect: left=162 top=126 right=178 bottom=294
  392. -- title width / last selected line: 0
  393. -- icon id / first selected line: 0 / 0
  394. -- text alignment: 0
  395. -- font id: 3
  396. -- text size: 9
  397. -- style flags: 0
  398. -- line height: 12
  399. -- part name: 
  400.  
  401.  
  402. -- part 34 (button)
  403. -- low flags: 00
  404. -- high flags: 0000
  405. -- rect: left=462 top=28 right=50 bottom=484
  406. -- title width / last selected line: 0
  407. -- icon id / first selected line: 0 / 0
  408. -- text alignment: 1
  409. -- font id: 0
  410. -- text size: 12
  411. -- style flags: 0
  412. -- line height: 16
  413. -- part name: 
  414. ----- HyperTalk script -----
  415. on mouseUp
  416.   visual effect iris open
  417.   go to card id 2207
  418. end mouseUp
  419.  
  420.  
  421.  
  422.  
  423. -- part 36 (button)
  424. -- low flags: 00
  425. -- high flags: 6005
  426. -- rect: left=39 top=320 right=338 bottom=58
  427. -- title width / last selected line: 0
  428. -- icon id / first selected line: 0 / 0
  429. -- text alignment: 1
  430. -- font id: 0
  431. -- text size: 12
  432. -- style flags: 0
  433. -- line height: 16
  434. -- part name: inNY
  435.  
  436.  
  437. -- part contents for card part 33
  438. ----- text -----
  439.     If you want more than one shirt size,  print a separate order for each size.