home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 14 / 014.d81 / q&d.pollster (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  322 lines

  1. 0 remsave"q&d.pollster",8
  2. 100 rem"[209][160]&[160][196][160][208]ollster 5/24/85"
  3. 101 open15,8,15:forc=54272to54296:pokec,0:next
  4. 102 poke53281,7:poke53280,7:print"[144]"
  5. 103 ad=120
  6. 104 print"[147]"
  7. 105 dimq$(500),an$(ad)
  8. 106 da$="---------------------------------------"
  9. 107 dimq1$(10),a1$(15),a2$(15,10),al(15),tg(15),an(15)
  10. 108 us$="[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  11. 109 gosub44000:q=1:goto10000
  12. 110 reminput answers from disk
  13. 120 print#15,"i0":open8,8,8,"poll.d."+ps$
  14. 125 input#15,a:ifa=62then170
  15. 140 ac=0
  16. 150 input#8,an$(ac)
  17. 151 print".";
  18. 160 ifan$(ac)<>"///"thenac=ac+1:goto150
  19. 165 an$(ac)=""
  20. 170 close8
  21. 200 rem done reading in.
  22. 210 return
  23. 10000 gosub20000
  24. 11000 print"[147]";
  25. 11050 ifr=1then11700
  26. 11100 ifcm$="quit"then11600
  27. 11200 gosub21000
  28. 11300 gosub12000
  29. 11400 print"[147]";
  30. 11500 goto11000
  31. 11600 rem
  32. 11610 gosub40000
  33. 11700 run
  34. 12000 rem
  35. 12010 iftype=1thengosub35000:goto12140
  36. 12020 iftype=2thengosub22000:goto12140
  37. 12140 rem
  38. 12150 rem
  39. 12300 iftype=1thengosub37000:goto12390
  40. 12310 iftype=2thengosub25000:goto12390
  41. 12390 rem
  42. 12400 ifcm$<>"quit"thenifk$<>"_"thengosub12600
  43. 12410 ifk$="_"thenifq>1thenq=q-1:gosub39000:return
  44. 12500 return
  45. 12600 rem
  46. 12610 dp=dp+1:ifq$(dp)<>"?"thenifq$(dp)<>"///"then12610
  47. 12612 q=q+1:ifq$(dp)="///"thendp=0:q=1
  48. 12620 return
  49. 20000 rem
  50. 20010 qc=0
  51. 20015 fi$="poll.q."+ps$
  52. 20016 open8,8,8,fi$
  53. 20020 input#8,q$(qc)
  54. 20030 ifq$(qc)="///"thenqc=qc-1:goto20080
  55. 20040 qc=qc+1:goto20020
  56. 20080 rem
  57. 20082 close8
  58. 20085 dp=0:gosub50000:ifr<>1thengosub110
  59. 20090 return
  60. 21000 rem
  61. 21005 ds=dp+1
  62. 21010 type=val(q$(ds)):ds=ds+1
  63. 21020 iftype=1thengosub27000:goto21040
  64. 21030 iftype=2thengosub28000:goto21040
  65. 21040 return
  66. 22000 rem
  67. 22010 print"";
  68. 22020 print"[209]uestion: "q;tab(21)mx"answer";:ifmx<>1thenprint"s";
  69. 22022 print" allowed"
  70. 22025 printda$
  71. 22030 forc1=1tonl:printq1$(c1):next
  72. 22035 printda$
  73. 22040 forc1=1toac
  74. 22050 forc2=1toal(c1):printspc(4);
  75. 22055 ifan$(an(c1))<>""thenifan$(an(c1))<>"0"thenprint"";
  76. 22056 printa2$(c1,c2)
  77. 22058 iftg(c1)<>0thenprintspc(6)us$;
  78. 22059 ifan$(an(c1))<>""theniftg(c1)<>0thenprint:print"[145]"an$(an(c1));
  79. 22060 iftg(c1)<>0thenprint
  80. 22061 next
  81. 22065 next
  82. 22070 return
  83. 23000 rem
  84. 23010 vs=vt:vt=19:gosub61000:vt=vs:           print""da$
  85. 23020 iftype<>1thenprint"   [198]unction keys move cursor[160]([160]>[160])     "
  86. 23030 iftype=2thenprint"   [211]pace bar toggles selections.       "
  87. 23035 iftype=1thenprint"   [208]ress space bar then type answer.   "
  88. 23040 print"   [208]ress [210][197][212][213][210][206] for next question.     "
  89. 23050 print"   [208]ress _ for previous question.      "
  90. 23055 print"   [208]ress [195][212][210][204]-[199] to quit.               "
  91. 23060 return
  92. 25000 gosub23000
  93. 25005 a=1:vt=4+nl
  94. 25006 rem
  95. 25010 ht=1:gosub60000
  96. 25015 gosub61000:print">";
  97. 25020 getk$:ifk$=""then25020
  98. 25025 print"[157] ";
  99. 25026 ifk$="[145]"ork$=""thenk$="[133]"
  100. 25027 ifk$=""ork$="[157]"thenk$="[136]"
  101. 25030 ifk$="[135]"ork$="[136]"thena=a+1:vt=vt+al(a-1)+tg(a-1):ifa>acthena=1:vt=4+nl
  102. 25040 ifk$="[133]"ork$="[134]"thena=a-1:vt=vt-al(a)-tg(a):ifa=0thena=ac:vt=4+nl:gosub62000
  103. 25050 ifk$=" "ork$="[160]"thengosub25999:k$=""
  104. 25060 ifk$=chr$(13)thenreturn
  105. 25070 ifk$="_"thenreturn
  106. 25075 ifk$=""thencm$="quit":return
  107. 25080 goto25006
  108. 25999 rem
  109. 26000 iftype=2thengosub26002:return
  110. 26001 iftype=1thengosub37000:return
  111. 26002 na=0:forc=1toac:ifan$(an(c))<>""thenifan$(an(c))<>"0"thenna=na+1
  112. 26004 next
  113. 26005 iftg(a)=0thenifan$(an(a))="1"thenan$(an(a))="0":goto26015
  114. 26006 iftg(1)=1thenifan$(an(a))<>""thengosub36000:goto26015
  115. 26007 ifmx=1thenforc=1toac:an$(an(c))="":next:ontg(a)+1gosub41000,36000:goto26015
  116. 26008 iftg(a)=0thenifna=mxthenifval(an$(an(a)))=0thengosub59000:return
  117. 26010 iftg(a)=0thenifval(an$(an(a)))<>0thenan$(an(a))="0":goto26012
  118. 26011 iftg(a)=0thenan$(an(a))="1"
  119. 26012 iftg(a)=1thenif((na<mx)or(len(an$(an(a))))>0)thengosub36000:goto26015
  120. 26013 iftg(a)=1thenifna=mxtheniflen(an$(an(a)))=0thengosub64000:return
  121. 26014 iftg(a)=1thengosub36000:goto26015
  122. 26015 rem
  123. 26020 gosub22000
  124. 26025 rem
  125. 26030 return
  126. 27000 rem
  127. 27010 gosub29000
  128. 27020 ac=val(q$(ds)):ds=ds+1
  129. 27030 foran=1toac
  130. 27040 gosub34000
  131. 27050 next
  132. 27060 return
  133. 28000 rem
  134. 28010 gosub29000
  135. 28020 ac=val(q$(ds)):ds=ds+1:mx=val(q$(ds)):ds=ds+1
  136. 28030 foran=1toac
  137. 28040 gosub30000
  138. 28042 gosub31000
  139. 28044 gosub32000
  140. 28046 forao=1toal(an)
  141. 28048 gosub33000
  142. 28049 next
  143. 28050 next
  144. 28060 return
  145. 29000 rem
  146. 29010 nl=val(q$(ds)):ds=ds+1
  147. 29020 forlc=1tonl
  148. 29030 q1$(lc)=q$(ds):ds=ds+1
  149. 29040 next
  150. 29050 return
  151. 30000 rem
  152. 30010 an(an)=val(q$(ds)):ds=ds+1:return
  153. 31000 rem
  154. 31010 al(an)=val(q$(ds)):ds=ds+1:return
  155. 32000 rem
  156. 32010 tg(an)=val(q$(ds)):ds=ds+1:return
  157. 33000 rem
  158. 33010 a2$(an,ao)=q$(ds):ds=ds+1:return
  159. 34000 rem
  160. 34010 an(an)=val(q$(ds)):ds=ds+1:return
  161. 35000 rem
  162. 35010 print"";
  163. 35020 print"[209]uestion "q
  164. 35025 printda$
  165. 35030 forc1=1tonl:printq1$(c1):next
  166. 35040 printda$
  167. 35050 forc1=1toac
  168. 35060 printspc(6)us$;:ht=7:gosub60000:iflen(an$(an(c1)))<>0thenprintan$(an(c1));
  169. 35061 print
  170. 35070 next
  171. 35080 return
  172. 36000 rem
  173. 36010 print:printspc(6);
  174. 36020 gosub38000:ht=7:gosub60000:printus$;:gosub60000:printl$;
  175. 36030 return
  176. 37000 rem
  177. 37010 vt=4+nl
  178. 37020 gosub23000:gosub61000:ht=1:gosub60000:print">";
  179. 37030 getk$
  180. 37031 ifk$<>" "thenifk$<>"[160]"thenifk$<>chr$(13)thenifk$<>"_"thenifk$<>""then37030
  181. 37035 ifk$=""thencm$="quit"
  182. 37040 ifk$=chr$(13)ork$="_"ork$=""thenreturn
  183. 37050 a=1:gosub42000:gosub61000
  184. 37060 ht=7:gosub60000:gosub38000:ht=7:gosub60000:printus$;:gosub60000:printl$
  185. 37070 ifan$(an(a))=""thenforc1=atoac:an$(an(c1))="":next:gosub35000:goto37020
  186. 37080 a=a+1:ifa>acthenk$="":goto37020
  187. 37090 goto37060
  188. 38000 rem
  189. 38002 dl$=chr$(20):x$="[164]"
  190. 38005 l$="":cr$=chr$(13):bs$="[157]":fs$=""
  191. 38010 forl1=1tolen(us$)
  192. 38020 print""x$bs$;
  193. 38021 getk$:ifk$=""thenprint"[146]"x$bs$;:goto38020
  194. 38022 poke198,0:print"[146]";
  195. 38023 ifk$=dl$thenk$=bs$
  196. 38024 ifl1<len(an$(an(a)))thenx$=mid$(an$(an(a)),l1+1,1)
  197. 38025 ifl1>=len(an$(an(a)))thenx$="[164]"
  198. 38030 ifk$=cr$thenan$(an(a))=l$:print" "bs$;:return
  199. 38031 ifk$=","thenk$=";"
  200. 38032 ifk$=":"thenk$="-"
  201. 38033 ifk$=chr$(34)thenk$="'"
  202. 38034 ifk$=bs$thenifl1>len(an$(an(a)))thenan$(an(a))=l$
  203. 38035 ifk$=bs$thenifl1>1thengosub38200:goto38020
  204. 38036 ifk$=fs$thenht=7:gosub60000:gosub38100:x$="[164]":goto38020
  205. 38040 ifk$<" "ork$>"z"then38020
  206. 38045 ifl1=len(us$)thengosub59000:goto38020
  207. 38050 l$=l$+k$:printk$;
  208. 38060 next
  209. 38070 return
  210. 38100 printl$mid$(an$(an(a)),l1);:l$=l$+mid$(an$(an(a)),l1):l1=len(l$)+1:return
  211. 38200 gosub63000:poke782,peek(782)-1:poke783,0:sys65520
  212. 38205 x$=right$(l$,1)
  213. 38210 l1=l1-1:l$=mid$(left$(" "+l$,l1),2)
  214. 38220 print"[146]"x$bs$;
  215. 38230 return
  216. 39000 rem
  217. 39010 dp=dp-1:ifq$(dp)<>"?"then39010
  218. 39020 return
  219. 40000 rem
  220. 40010 forc1=adto1step-1
  221. 40020 ifan$(c1)<>""thentp=c1:c1=0
  222. 40030 next
  223. 40035 print"[208]lease, wait....";
  224. 40040 print#15,"s0:poll.d."+ps$
  225. 40050 open8,8,8,"poll.d."+ps$+",s,w"
  226. 40060 forc1=0totp
  227. 40070 print#8," "an$(c1):print".";
  228. 40080 next
  229. 40085 print#8,"///"
  230. 40090 close8:print
  231. 40100 return
  232. 41000 an$(an(a))="1":return
  233. 42000 vs=vt:vt=19:gosub61000:vt=vs:           print
  234. 42010 print"     [212]ype your response.               "
  235. 42020 print"     [208]ress [210][197][212][213][210][206][160]after each line.     "
  236. 42030 print"     [197]dit each line with [195][210][211][210][160]keys.    "
  237. 42040 print""da$
  238. 42060 return
  239. 44000 print"[147]";
  240. 44010 print"[209][160]&[160][196][160][208]ollster"
  241. 44020 print:print:print"[204]oadstar [208]oll"
  242. 44030 print:print:print"[215]hich topic do you choose?"
  243. 44040 print:print"1 = [196]emographics"
  244. 44050 print:print"2 = [200]ardware"
  245. 44060 print:print"3 = [211]oftware"
  246. 44070 print:print"4 = [204]oadstar"
  247. 44080 print:print"5 = [204]eave the [208]olls"
  248. 44090 getk$:ifk$=""then44090
  249. 44091 ifk$>"5"ork$<"1"thengosub59000:goto44090
  250. 44094 print#15,"i0"
  251. 44095 open8,8,8,"$":forc=1to142:get#8,l$:next:n$="":forc=1to16:get#8,l$:n$=n$+l$
  252. 44096 next:close8:ifn$<>"loadstar #14 s-2"thengosub53000:goto44094
  253. 44099 ps$=""
  254. 44100 ifk$="1"thenps$="demographics"
  255. 44110 ifk$="2"thenps$="hardware"
  256. 44120 ifk$="3"thenps$="software"
  257. 44130 ifk$="4"thenps$="loadstar"
  258. 44140 ifk$="5"then45000
  259. 44145 print
  260. 44147 print""k$" "ps$
  261. 44150 re