home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1995 January / 1995-01b.d64 / surveytaker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  59 lines

  1. 10 poke53280,6:poke646,1:s$="survey"
  2. 20 print"[147]load a previous survey? (y/n)
  3. 30 [161]a$:[139]a$[179][177]"y"[167][139]a$[179][177]"n"[167]30
  4. 40 [139]a$[178]"y"[167][141]420:[139]q[179][177]0[167]280
  5. 50 q[178]4:[143] must match number questions in data statements!
  6. 60 [134]q$(q),a$(q),temp$(q)
  7. 70 [153]"i'll start a new survey.
  8. 80 print"please enter one-line answers.
  9. 90 [153]"press any key to begin. . .
  10. 100 geta$:ifa$=""then100
  11. 110 print"[147]":forx=1toq:readq$(x):printq$(x)"":gosub540:print:next
  12. 120 print"[147]would you like to change anything? (y/n)
  13. 130 [161]a$:[139]a$[179][177]"y"[167][139]a$[179][177]"n"[167]130
  14. 140 [139]a$[178]"n"[167]300
  15. 150 [153]"loadi'll repeat each question and answer.
  16. 160 print"if you don't want to change the answer,
  17. 170 [153]"just press enter.
  18. 180 print"if you do want to change something,
  19. 190 [153]"just type in your new answer.
  20. 200 print"when finished changing, press _":print"at the next question.
  21. 210 [153]"press any key to begin.
  22. 220 geta$:ifa$=""then220
  23. 230 printchr$(147):forx=1toq:print""q$(x)"":printa$(x)""
  24. 240 temp$(x)=a$(x):gosub540
  25. 250 ifa$(x)=""thena$(x)=temp$(x)
  26. 260 ifa$(x)="_"thena$(x)=temp$(x):goto280
  27. 270 next:goto120
  28. 280 print"press any key to continue. . .
  29. 290 [161]a$:[139]a$[178]""[167]290
  30. 300 [153]"load1. print to commodore printer
  31. 310 print"2. save to disk and quit
  32. 320 [153]"3. quit without saving or printing
  33. 330 geta$:ifa$<>"1"thenifa$<>"2"thenifa$<>"3"then330
  34. 340 ifa$="1"thengosub370:goto280
  35. 350 ifa$="2"thengosub470
  36. 360 end
  37. 370 print"make sure printer is ready
  38. 380 [153]"then press any key. . .
  39. 390 geta$:ifa$=""then390
  40. 400 open4,4:cmd4:forx=1toq:printq$(x):printa$(x):print:next:print#4:close4
  41. 410 return
  42. 420 q=0:print"loading previous survey. . .
  43. 430 [159]1,8,0,s$:[132]1,q:[139]q[178]0[167][153]"no survey found.":[160]1:[142]
  44. 440 [134]q$(q),a$(q),temp$(q)
  45. 450 [129]x[178]1[164]q:[132]1,q$(x):[132]1,a$(x):[130]:[160]1
  46. 460 [153]"load":[129]x[178]1[164]q:[153]q$(x):[153]a$(x):[153]:[130]:[142]
  47. 470 [153]"make sure disk drive is ready
  48. 480 print"then press any key. . .
  49. 490 [161]a$:[139]a$[178]""[167]490
  50. 500 [153]"saving survey. . .
  51. 510 open15,8,15:print#15,"s0:"s$:rem erases old survey if it exists
  52. 520 open1,8,1,s$:print#1,q:forx=1toq:print#1,q$(x):print#1,a$(x):next
  53. 530 close1:return
  54. 540 open1,0:input#1,a$(x):print:close1:return:rem input without question mark
  55. 550 datawhat would you do in a tornado warning?
  56. 560 datado you eat eggs?
  57. 570 datathe commodore 64 is a (1) computer      (2) power ranger (3) vcr
  58. 580 data(t/f) jessie helms should retire.
  59.