home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Productivity Pak 2 / rerun-productivity-pak-ii.d64 / dfcalc (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  17.4 KB  |  575 lines

  1. 10 iffl=0thenfl=1:load"dp] dos5.1",8,1
  2. 11 iffl=1thenfl=2:sys52224:rem (c) by commodore
  3. 600 fore=0to24:poke54272+e,0:next:poke54296,15:goto3000
  4. 602 poke54277,58:poke54278,16:poke54273,35:poke54272,134
  5. 604 poke54276,33:fore=1to100:next:poke54276,16:return
  6. 3000 rem dfcalc 1.5a program for datafile by mike konshak (c)1986
  7. 3004 poke53281,0:poke53280,0:print"[158]":open4,4:open3,3:gosub4000
  8. 3006 rem----dim arrays
  9. 3008 b$=chr$(32):pi=3.14159265:cr$=chr$(13)
  10. 3010 fori=1to100:s$=s$+chr$(32):nexti
  11. 3012 dim f$(31),t%(31),l%(31),rec$(31),sum(17),buf(17)
  12. 3014 dim f(17),c$(17,15),pc(18),tt$(5),hc$(17):goto3044
  13. 3016 rem----get
  14. 3018 geta$:ifa$=""then3018
  15. 3020 return
  16. 3022 rem----prompt
  17. 3024 print"[153] press c[153][146]ont r[153][146]edo s[153][146]tart j[153][146]ump e[153][146]xit[158]"
  18. 3026 gosub3018:return
  19. 3028 rem----clear top 13 rows of screen
  20. 3030 forz=1to13:poke781,z:sys59903:nextz:return
  21. 3032 rem----disk error
  22. 3034 input#15,en,em$,et,es:if(en<20)or(en=62)thenet=0:return
  23. 3036 print" [150]disk error[146]"en"[157], "em$","et"[157],"es"[158]":et=8
  24. 3038 print" [153]press any key[153][146] to continue[158]"
  25. 3040 gosub3018:close5:close15:return
  26. 3042 rem----starting menu
  27. 3044 print"[158][147]   calculated reports program rev 1.5a "
  28. 3045 print" [158]  copyright (c)1986 by mike konshak   "
  29. 3046 print"[153]   use  o[153][146]ld predefined format"
  30. 3047 print"    or  n[153][146]ew format"
  31. 3048 print"        $[153][146] disk directory 4[153][146]"
  32. 3049 print"        q[153][146]uit program"
  33. 3050 print" transfer to:"
  34. 3051 print"        d[153][146] datafile dbms"
  35. 3052 print"        p[153][146] dfprint reports-lists-labels"
  36. 3054 print" [158]      press the appropriate key       [146]"
  37. 3056 gosub3018:ifa$="q"thenclose3:close4:print"[147]":end
  38. 3058 ifa$="n"thenk=1:goto3068
  39. 3059 ifa$="d"thenprint"[147][144]load"chr$(34)"datafile"chr$(34)",8":goto3064
  40. 3060 ifa$="o"thenk=2:fl=0:goto3068
  41. 3061 ifa$="p"thenprint"[147][144]load"chr$(34)"dfprint"chr$(34)",8":goto3064
  42. 3062 ifa$="$"ora$="4"thengosub3940:goto3044
  43. 3063 gosub602:goto3056
  44. 3064 print:print:print:print:print"run[158]"
  45. 3065 poke631,19:poke632,13:poke633,13:poke634,13:poke635,13:poke636,13
  46. 3066 poke198,6:new:end
  47. 3067 rem----open datafile, read file structure
  48. 3068 print"[153][147] available datafile record files are:[158]":@"$0:df]*"
  49. 3072 print"[153] name of datafile record file?[158]"
  50. 3074 print" ? "nf$:input"[145] ";a$:ifa$=""then3044
  51. 3076 ifa$=nf$then3096
  52. 3078 nf$=a$
  53. 3080 open15,8,15:open5,8,5,"0:df] "+nf$+",s,r":gosub3034:ifet=8then3044
  54. 3082 ifen=62thengosub3036:goto3044
  55. 3084 input#5,r,f,x:gosub3034:ifet=8then3044
  56. 3088 forn=1tof:input#5,f$(n),l%(n):nextn:gosub3034:ifet=8then3044
  57. 3090 close5:close15
  58. 3092 ifk=2then3386
  59. 3094 rem----define new format
  60. 3096 ck=1:print"[158][147]     define report header format    [146]"
  61. 3098 print"[153] enter width of report (136 max)"
  62. 3100 print"[158] ? 0[157][157]"pw:input"[145] ";pw:ifpw>136thenprint"[145][145][145][145][145][145][145]":goto3098
  63. 3102 print"[153] enter number of title lines in the"
  64. 3104 print" report header (4 lines max)"
  65. 3106 print"[158]  "nl:input"[145] ";nl:ifnl>4thenprint"[145][145][145][145][145][145][145]":goto3102
  66. 3108 ifnl=0thentt$(1)="[153]no titles":goto3118
  67. 3110 print:forj=1tonl:print"[153] title #[158]"j:print" ? >[157]"tt$(j)
  68. 3112 iflen(tt$(j))>37thenprint"[145]";
  69. 3114 input"[145] ";tt$(j):iftt$(j)=""thentt$(j)=">"
  70. 3116 nextj
  71. 3118 gosub3024:ifa$="e"then3044
  72. 3120 ifa$="j"then3386
  73. 3122 ifa$="r"ora$="s"then3096
  74. 3124 rem----print field info for reference
  75. 3126 print"[147]":fori=1to(22-int(f/2)):printchr$(17);:nexti
  76. 3128 print"[153] field name(length) data for [158]"nf$
  77. 3130 oe=1:if(f/2)=int(f/2)thenoe=0:goto3132
  78. 3132 of=int(f/2):fori=1toof+oe
  79. 3134 print" "i"[146][153]"f$(i)l%(i);
  80. 3136 ifoe=1then3140
  81. 3138 printtab(19)""i+of"[146][153]"f$(i+of)l%(i+of):goto3142
  82. 3140 ifi+of<fthenprinttab(19)""i+of+1"[146][153]"f$(i+of+1)l%(i+of+1)
  83. 3142 nexti
  84. 3144 rem----enter columnar data
  85. 3146 print"[158]     define report columnar format    [146]"
  86. 3148 gosub3030
  87. 3150 print"[153] calculate the total length of all"
  88. 3152 print" fields to be included in the report."
  89. 3154 print" allowing 2 spaces between each"
  90. 3156 print" column."
  91. 3158 print" enter the number of columns in report."
  92. 3160 print" (16 columns max)"
  93. 3162 print"[158] ? 0[157][157]"nc:input"[145] ";nc:ifnc>16then3148
  94. 3164 gosub3024:ifa$="e"then3044
  95. 3166 ifa$="j"then3386
  96. 3168 ifa$="r"then3148
  97. 3170 ifa$="s"then3096
  98. 3172 rem----column position
  99. 3174 fori=1tonc:gosub3030
  100. 3176 print"[153] enter position of column [158]"i""
  101. 3178 print" ? 0[157][157]"pc(i):input"[145] ";pc(i):ifpc(i)=0then3174
  102. 3180 ifpc(i)>pwthenprint"[145][145]":goto3178
  103. 3182 nexti
  104. 3184 gosub3024:ifa$="e"then3044
  105. 3186 ifa$="j"then3386
  106. 3188 ifa$="r"then3174
  107. 3190 ifa$="s"then3096
  108. 3192 fori=1tonc:gosub3030
  109. 3194 rem----column heading
  110. 3196 print"[153] enter heading of column [158]"i
  111. 3198 print"[153] heading is [158]";:ifi=ncthenprintpw-pc(i);:goto3202
  112. 3200 printpc(i+1)-2-pc(i);
  113. 3202 print"[146] [153]characters wide"
  114. 3204 print"[158] ? >[157]"hc$(i):input"[145] ";hc$(i):ifhc$(i)="r"then3192
  115. 3206 nexti
  116. 3208 gosub3024:ifa$="e"then3044
  117. 3210 ifa$="j"then3386
  118. 3212 ifa$="r"then3192
  119. 3214 ifa$="s"then3096
  120. 3216 rem----column contents data
  121. 3218 fori=1tonc:print" [158] format input routines for column"i
  122. 3220 gosub3030:print"[153] enter contents of column [158]"i
  123. 3222 print"[153] choose f[153][146]ield data in records"
  124. 3224 print"        e[153][146]quation"
  125. 3225 print"        r[153][146]unning total (balance)"
  126. 3226 print"        #[153][146] record number"
  127. 3228 print"[158] ? f[157]"left$(c$(i,1),1):input"[145] ";c$:c$(i,1)=c$+mid$(c$(i,1),2)
  128. 3230 ifc$="#"thenc$(i,1)="#":c$(i,13)="n":goto3344
  129. 3232 ifc$="f"then3238
  130. 3234 ifc$="e"then3260
  131. 3235 ifc$="r"then3239
  132. 3236 print"[145][145]":gosub602:goto3228
  133. 3238 print"[153] which field # will be in column [158]"i:goto3241
  134. 3239 print"[153] which column # is to have a running"
  135. 3240 print" total in column [158]"i"[146][157]? [153]enter 1[153][146] thru "i-1:goto3245
  136. 3241 print"[153] enter 1[153][146] thru "f
  137. 3242 print"[158] ? "mid$(c$(i,1),2,2):input"[145] ";c$
  138. 3243 if(val(c$)>f)or(val(c$)<=0)thenprint"[145][145]":goto3242
  139. 3244 goto3247
  140. 3245 print"[158] ? "mid$(c$(i,1),2,2):input"[145] ";c$
  141. 3246 if(val(c$)>i-1)or(val(c$)<=0)thenprint"[145][145]":goto3245
  142. 3247 c$(i,1)=left$(c$(i,1),1)+c$
  143. 3248 goto3328
  144. 3250 gosub3024:ifa$="e"then3044
  145. 3252 ifa$="j"then3386
  146. 3254 ifa$="r"then3220
  147. 3256 ifa$="s"then3096
  148. 3258 rem----column contents calculation
  149. 3260 eq=2:op=1:forj=0to3:rs$(j)="":nextj:goto3264
  150. 3262 eq=eq+4:op=op+1
  151. 3264 gosub3030:print"[153] enter equation [158]"op"[153][146]for column [158]"i
  152. 3266 ifop>1thengosub3308
  153. 3268 print" res[158][146]="rs$(op-1)
  154. 3270 print"[153] operand x[158]? .[157]"c$(i,eq)
  155. 3272 print"[153] operator [158]? .[157]"c$(i,eq+1)
  156. 3274 print"[153] operand y[158]? .[157]"c$(i,eq+2)
  157. 3276 print""tab(10):inputc$(i,eq)
  158. 3278 printtab(10):inputc$(i,eq+1)
  159. 3280 printtab(10):inputc$(i,eq+2)
  160. 3282 gosub3308:print" res="rs$(op)"[158]":c$(i,14)=rs$(op)
  161. 3284 gosub3024:ifa$="e"then3044
  162. 3286 ifa$="j"then3386
  163. 3288 ifa$="r"then3220
  164. 3290 ifa$="s"then3096
  165. 3292 ifeq=10then3328
  166. 3294 print"[145][153] expand equation? y[153][146] or n[158][146]             "
  167. 3296 print" ? n[157]"c$(i,eq+3):input"[145] ";c$(i,eq+3)
  168. 3298 ifc$(i,eq+3)="y"then3262
  169. 3300 :
  170. 3302 ifc$(i,eq+3)="n"thenforj=eq+4to12:c$(i,j)=".":nextj:goto3328
  171. 3304 print"[145][145]":goto3294
  172. 3306 rem----combine operations
  173. 3308 onopgoto3310,3312,3318
  174. 3310 rs$(1)=c$(i,2)+c$(i,3)+c$(i,4):goto3324
  175. 3312 ifc$(i,6)="res"then3316
  176. 3314 rs$(2)=c$(i,6)+c$(i,7)+"("+rs$(1)+")":goto3324
  177. 3316 rs$(2)="("+rs$(1)+")"+c$(i,7)+c$(i,8):goto3324
  178. 3318 ifc$(i,10)="res"then3322
  179. 3320 rs$(3)=c$(i,10)+c$(i,11)+"("+rs$(2)+")":goto3324
  180. 3322 rs$(3)="("+rs$(2)+")"+c$(i,11)+c$(i,12)
  181. 3324 return
  182. 3326 rem----field totals
  183. 3328 gosub3030:print"[153] set end-of-column operation"
  184. 3330 print" options: t[153][146]otal sum of column"
  185. 3332 print"          a[153][146]verage contents of column"
  186. 3334 print"          n[153][146]o operation to column"
  187. 3336 print"[158] ? n[157]"c$(i,13):input"[145] ";c$(i,13)
  188. 3338 if(c$(i,13)="t")or(c$(i,13)="a")or(c$(i,13)="n")then3344
  189. 3340 print"[145][145]":goto3336
  190. 3342 rem----set justifications
  191. 3344 gosub3030:print"[153] set column justification
  192. 3346 [153]" options: lprintwaiteft"
  193. 3348 [153]"          rprintwaitight"
  194. 3350 [153]"          cprintwaiturrency ($.00)"
  195. 3352 [153]"          pprintwaitercent (%)"
  196. 3354 [153]"          dprintwaitecimals to right"
  197. 3356 [153]"sys ? lcmd"[200](c$(i,0),1):[133]"on ";c$:c$(i,0)[178]c$[170][202](c$(i,0),2)
  198. 3358 [139](c$[178]"l")[176](c$[178]"r")[176](c$[178]"c")[167]3370
  199. 3360 [139](c$[178]"p")[176](c$[178]"d")[167]3364
  200. 3362 [153]"onon":[137]3356
  201. 3364 [153]"print # of places to the right of decimal:"
  202. 3366 [153]"sys ? 1cmd"[202](c$(i,0),2,1):[133]"on ";c$
  203. 3368 c$(i,0)[178][200](c$(i,0),1)[170]c$
  204. 3370 [141]3024:[139]a$[178]"e"[167]3044
  205. 3372 [139]a$[178]"j"[167]3386
  206. 3374 [139]a$[178]"r"[167]3220
  207. 3376 [139]a$[178]"s"[167]3096
  208. 3378 [129]j[178]0[164]14:[139]c$(i,j)[178]""[167]c$(i,j)[178]"."
  209. 3380 [130]j:[130]i
  210. 3382 fl[178]1
  211. 3384 [143]----operations menu
  212. 3386 [153]"load sys  calculated reports operations menu  wait"
  213. 3388 [153]"print    current datafile: sys"nf$
  214. 3390 [139]fl[178]1[167][153]"   sprintwaitave report format"
  215. 3392 [153]"   lprintwaitoad report format"
  216. 3394 [139]fl[178]1[167][153]"   cprintwaithange report format"
  217. 3396 [139]fl[178]1[167][153]"   pprintwaitrint records"
  218. 3397 [153]"   rprintwaiteconfigure printer, optionsys"p;:[139]p[178]4[167][153]"cmdcmdscreenwait";
  219. 3398 [153]:[153]"   $printwait disk directory 4wait"
  220. 3400 [153]"   ewaitprintxit this datafile"
  221. 3402 [153]"sys        press the appropriate key      wait"
  222. 3404 [141]3018:[139]a$[178]"e"[175]ck[178]0[167]3044
  223. 3406 [139]a$[178]"s"[167]3430
  224. 3408 [139]a$[178]"l"[167]3456
  225. 3410 [139]a$[178]"c"[167]3096
  226. 3412 [139]a$[178]"p"[167]3496
  227. 3414 [139]a$[178]"$"[176]a$[178]"4"[167][141]3940:[137]3386
  228. 3416 [139]a$[178]"e"[175]ck[178]1[167]3420
  229. 3417 [139]a$[178]"r"[167][141]4000:[137]3386
  230. 3418 [141]602:[137]3404
  231. 3420 [153]"on defyou have not saved your new format!!!waitsys"
  232. 3422 [153]" do you still want to exit? ywait or nwait?   "
  233. 3424 [141]3018:[139]a$[178]"y"[167]3044
  234. 3426 [137]3386
  235. 3428 [143]----save report format
  236. 3430 [153]"print save under what file name?"
  237. 3432 [153]"sys ? "nf$:[133]"on ";cf$:[139]cf$[178]""[167]3386
  238. 3434 [153]" saving calculated report format"
  239. 3436 [159]15,8,15:[152]15,"s0:cr] "[170]cf$:[141]3034:[139]et[178]8[167]3386
  240. 3438 [159]5,8,5,"0:cr] "[170]cf$[170]",s,w":[141]3034:[139]et[178]8[167]3386
  241. 3440 [152]5,pw;cr$;nl;cr$;nc:[141]3034:[139]et[178]8[167]3386
  242. 3442 [129]j[178]1[164]nl:[152]5,tt$(j):[130]j:[141]3034:[139]et[178]8[167]3386
  243. 3444 [129]i[178]1[164]nc:[152]5,pc(i);cr$;hc$(i):[141]3034:[139]et[178]8[167]3386
  244. 3446 [129]j[178]0[164]14:[152]5,c$(i,j):[130]j:[141]3034:[139]et[178]8[167]3386
  245. 3448 [130]i
  246. 3450 [152]5,"eof"
  247. 3452 [160]5:[160]15:ck[178]0:[137]3386
  248. 3454 [143]----load report format
  249. 3456 [153]"loadprint available calc format files are:sys":@"$0:cr]*"
  250. 3457 [153]"print load format from what file?sys"
  251. 3458 [153]" ? "nf$:[133]"on ";cf$:[139]cf$[178]""[167]3386
  252. 3460 [153]" loading calculated report format"
  253. 3462 [159]15,8,15:[159]5,8,5,"0:cr] "[170]cf$[170]",s,r":[141]3034:[139]et[178]8[167]3386
  254. 3464 [139]en[178]62[167][141]3036:[137]3386
  255. 3466 [132]5,pw,nl,nc:[141]3034:[139]et[178]8[167]3386
  256. 3468 [129]j[178]1[164]nl:[132]5,tt$(j):[130]j:[141]3034:[139]et[178]8[167]3386
  257. 3470 [129]i[178]1[164]nc:[132]5,pc(i),hc$(i):[141]3034:[139]et[178]8[167]3386
  258. 3472 [129]j[178]0[164]14:[132]5,c$(i,j):[130]j:[141]3034:[139]et[178]8[167]3386
  259. 3474 [130]i
  260. 3476 [160]5:[160]15
  261. 3478 fl[178]1:[137]3386
  262. 3480 [143]----start print process
  263. 3482 [143]----open datafile channel and position to records
  264. 3484 [159]15,8,15:[159]5,8,5,"0:df] "[170]nf$[170]",s,r":[141]3034:[139]et[178]8[167]3386
  265. 3486 [139]en[178]62[167][141]3036:[137]3386
  266. 3488 [132]5,rr,f,xr:[141]3034:[139]et[178]8[167]3386
  267. 3490 [129]n[178]1[164]f:[132]5,f$(n),l%(n):[130]n:[141]3034:[139]et[178]8[167]3386
  268. 3492 [142]
  269. 3494 [143]----print options menu
  270. 3496 pg[178]1:[153]"sysload            print options menu         wait"
  271. 3500 [153]"     aprintwaitll records in file"
  272. 3502 [153]"     fprintwaitind records with common fields"
  273. 3504 [153]"     eprintwaitxit back to start"
  274. 3506 [153]"   position paper at top of page"
  275. 3508 [153]" sys     press the appropriate key      "
  276. 3510 [141]3018:[139]a$[178]"e"[167]3386
  277. 3512 [139]a$[178]"a"[167]3550
  278. 3514 [139]a$[178]"f"[167]3520
  279. 3516 [141]602:[137]3510
  280. 3518 [143]----find record (search)
  281. 3520 [153]"loadsys     find records with common items    "
  282. 3522 [141]3484
  283. 3524 [129]n[178]1[164]f:[153]" "n"waitprint "f$(n):[130]n
  284. 3526 [133]"print which field is to be searchedsys";sf
  285. 3528 [139]sf[179]0[176]sf[177]f[167][153]"ononon":[137]3526
  286. 3530 [153]"print enter common itemwait":[153]" (the entire string is not required)"
  287. 3532 [153]"print "f$(sf)"waitsys ";:[133]t$
  288. 3534 [153]"load":[141]3568
  289. 3536 [129]i[178]1[164]xr:[139]p[179][177]4[167][153]" searching record"i"on"
  290. 3538 [129]n[178]1[164]f:[132]5,rec$(n):[130]n:[141]3034:[139]et[178]8[167]3386
  291. 3540 [139]t$[178][200](rec$(sf),[195](t$))[167][141]3622
  292. 3542 [130]i:[141]3662
  293. 3544 [152]pf,"file: "nf$","k"of"xr"records reported"
  294. 3545 [160]5:[160]15:[139]p[178]4[167]3565
  295. 3546 [129]i[178]1[164]60[171]pl:[141]4034:[130]i:[137]3496
  296. 3548 [143]----print all records
  297. 3550 [153]"load":[139]p[179][177]4[167][153]" printing heading"
  298. 3552 [141]3568:[141]3484
  299. 3554 [153]"on";:[129]i[178]1[164]xr:[139]p[179][177]4[167][153]" reading record #"i"on"
  300. 3556 [129]n[178]1[164]f:[132]5,rec$(n):[130]n:[141]3034:[139]et[178]8[167]3386
  301. 3558 [141]3622
  302. 3560 [130]i:[141]3662
  303. 3562 [152]pf,"file: "nf$","k"records reported"
  304. 3563 [160]5:[160]15:[139]p[178]4[167]3565
  305. 3564 [129]i[178]1[164]60[171]pl:[141]4034:[130]i:[137]3496
  306. 3565 [153]"press any keywait":[141]3018:[137]3496
  307. 3566 [143]----begin report/center title
  308. 3568 pl[178]0:ta[178]0:k[178]0:[129]j[178]1[164]nc:sum(j)[178]0:[130]j
  309. 3570 [129]j[178]1[164]nc:[139]c$(j,13)[179][177]"n"[167]tl[178]1
  310. 3572 [130]j:[129]j[178]1[164]nl:[139]tt$(j)[179][177]">"[167][141]3576
  311. 3574 [130]j:[137]3584
  312. 3576 m[178][181]((pw[171][195](tt$(j)))[173]2):[139]p[179][177]1[167]3580
  313. 3578 [152]pf,[200](s$,m)[170]tt$(j);b1$;:pl[178]pl[170]1:[142]
  314. 3580 [152]pf,[200](s$,m)[170]tt$(j);b1$:pl[178]pl[170]1:[142]
  315. 3582 [143]----position headings
  316. 3584 [141]3618:j[178]1:pc(nc[170]1)[178]pw[170]3:cw[178]pc(2)[171]2[171]pc(1)
  317. 3586 clm$[178]hc$(j)
  318. 3588 [139]c$(j,0)[178]"l"[167][141]3926:[137]3592
  319. 3590 [141]3918
  320. 3592 [139]pc(1)[177]1[167]3596
  321. 3594 [152]pf,clm$;:[137]3598
  322. 3596 [152]pf,[200](s$,pc(1)[171]1)[170]clm$;
  323. 3598 [129]j[178]2[164]nc
  324. 3600 cw[178]pc(j[170]1)[171]2[171]pc(j):clm$[178]hc$(j)
  325. 3602 [139]c$(j,0)[178]"l"[167][141]3926:[137]3606
  326. 3604 [141]3918
  327. 3606 [152]pf,[200](s$,2)[170]clm$;
  328. 3608 [130]j
  329. 3610 [141]4034
  330. 3612 [141]3618:pl[178]pl[170]3
  331. 3614 [142]
  332. 3616 [143]----print dashed line
  333. 3618 [129]j[178]1[164]pw:[152]pf,"-";:[130]j:[141]4034:[142]
  334. 3620 [143]----print file data
  335. 3622 [129]j[178]1[164]nc:buf(j)[178]0:[130]j:k[178]k[170]1:j[178]1
  336. 3624 pc(nc[170]1)[178]pw[170]3:cw[178]pc(2)[171]2[171]pc(1)
  337. 3626 [141]3740
  338. 3628 [141]3708
  339. 3630 [139]pc(1)[177]1[167]3636
  340. 3632 [152]pf,clm$;
  341. 3634 [137]3638
  342. 3636 [152]pf,[200](s$,pc(1)[171]1)[170]clm$;
  343. 3638 [129]j[178]2[164]nc
  344. 3640 cw[178]pc(j[170]1)[171]2[171]pc(j)
  345. 3642 [141]3740
  346. 3644 [141]3708
  347. 3646 [152]pf,[200](s$,2)[170]clm$;
  348. 3648 [130]j
  349. 3650 [141]4034
  350. 3652 pl[178]pl[170]1
  351. 3654 [143]----check # lines on page
  352. 3656 [139]pl[178]60[167][129]j[178]1[164]5:[141]4034:[130]j:pl[178]0:[137]3659
  353. 3658 [142]
  354. 3659 pg[178]pg[170]1:[152]pf,"page"pg:[141]3584:[137]3658
  355. 3660 [143]----print totals/averages
  356. 3662 [141]3618:[139]tl[178]0[167][142]
  357. 3664 j[178]1:cw[178]pc(2)[171]2[171]pc(1)
  358. 3666 [139]ta[178]0[167][141]3722:[141]3918:[137]3674
  359. 3668 [141]3732
  360. 3670 [139]c$(j,13)[178]"n"[167][141]3918:[137]3674
  361. 3672 [141]3708
  362. 3674 [139]pc(1)[177]1[167]3680
  363. 3676 [152]pf,clm$;
  364. 3678 [137]3682
  365. 3680 [152]pf,[200](s$,pc(1)[171]1)[170]clm$;
  366. 3682 [129]j[178]2[164]nc
  367. 3684 cw[178]pc(j[170]1)[171]2[171]pc(j)
  368. 3686 [139]ta[178]0[167][141]3722:[141]3918:[137]3694
  369. 3688 [141]3732
  370. 3690 [139]c$(j,13)[178]"n"[167][141]3918:[137]3694
  371. 3692 [141]3708
  372. 3694 [152]pf,[200](s$,2)[170]clm$;
  373. 3696 [130]j
  374. 3698 [141]4034
  375. 3700 [139]ta[178]0[167]ta[178]1:[137]3662
  376. 3702 [141]3618
  377. 3704 [142]
  378. 3706 [143]---determine justification
  379. 3708 [139][200](c$(j,0),1)[178]"l"[167][141]3926:[142]
  380. 3710 [139][200](c$(j,0),1)[178]"r"[167][141]3918:[142]
  381. 3712 [139]e[178]1[167][141]3918:[142]
  382. 3714 [139][200](c$(j,0),1)[178]"c"[167][141]3904:[142]
  383. 3716 [139][200](c$(j,0),1)[178]"d"[167][141]3906:[142]
  384. 3718 [141]3934:[142]
  385. 3720 [143]---determine total/avg label for column
  386. 3722 [139][200](c$(j,13),1)[178]"n"[167] clm$[178]"":[142]
  387. 3724 [139][200](c$(j,13),1)[178]"t"[167] clm$[178]"total":[142]
  388. 3726 [139]cw[179]7[167]clm$[178]"avg":[142]
  389. 3728 clm$[178]"average":[142]
  390. 3730 [143]---determine total/avg value for column
  391. 3732 [139][200](c$(j,13),1)[178]"n"[167] clm$[178]"":[142]
  392. 3734 [139][200](c$(j,13),1)[178]"t"[167] clm$[178][196](sum(j)):[142]
  393. 3736 [139]k[179][177]0[167]clm$[178][196](sum(j)[173]k)
  394. 3737 [142]
  395. 3738 [143]---determine contents of column
  396. 3740 [139][200](c$(j,1),1)[178]"#"[167] clm$[178][196](i):[137]3792
  397. 3742 [139][200](c$(j,1),1)[178]"f"[167] clm$[178]rec$([197]([202](c$(j,1),2,2))):[137]3792
  398. 3743 [139][200](c$(j,1),1)[178]"r"[167] clm$[178][196](sum([197]([202](c$(j,1),2,2)))):[137]3792
  399. 3744 [143]----calculations routine
  400. 3746 res[178]0:eq[178]0
  401. 3748 eq[178]eq[170]2
  402. 3750 [143]----operand x
  403. 3752 [139][200](c$(j,eq),1)[178]"f"[167] x[178][197](rec$([197]([202](c$(j,eq),2,2)))):[137]3762
  404. 3753 [139]c$(j,eq[170]1)[178]"++"[167] x[178][197]([202](c$(j,2),2,2)):[137]3762
  405. 3754 [139][200](c$(j,eq),1)[178]"c"[167] x[178]buf([197]([202](c$(j,eq),2,2))):[137]3762
  406. 3756 [139][200](c$(j,eq),3)[178]"res"[167] x[178]res:[137]3762
  407. 3758 [139][200](c$(j,eq),2)[178]"pi"[167] x[178]pi:[137]3762
  408. 3760 [139][200](c$(j,eq),1)[179][177]"."[167] x[178][197](c$(j,eq))
  409. 3762 eq[178]eq[170]2
  410. 3764 [143]----operand y
  411. 3766 [139][200](c$(j,eq),1)[178]"f"[167] y[178][197](rec$([197]([202](c$(j,eq),2,2)))):[137]3776
  412. 3767 [139]c$(j,eq[171]1)[178]"++"[167] y[178][197]([202](c$(j,4),2,2)):[137]3776
  413. 3768 [139][200](c$(j,eq),1)[178]"c"[167] y[178]buf([197]([202](c$(j,eq),2,2))):[137]3776
  414. 3770 [139][200](c$(j,eq),3)[178]"res"[167] y[178]res:[137]3776
  415. 3772 [139][200](c$(j,eq),2)[178]"pi"[167] y[178]pi:[137]3776
  416. 3774 y[178][197](c$(j,eq))
  417. 3776 [141]3800
  418. 3778 [139]c$(j,eq[170]1)[179][177]"y"[176]e[178]1[167]3788
  419. 3780 res[178]z
  420. 3782 [139]eq[178]12[167]3788
  421. 3784 [137]3748
  422. 3786 [143]----set value of column/buffers
  423. 3788 [139]e[178]1[167]clm$[178]"??error??":[137]3792
  424. 3790 clm$[178][196](z)
  425. 3792 buf(j)[178][197](clm$)
  426. 3794 sum(j)[178]sum(j)[170][197](clm$)
  427. 3796 [142]
  428. 3798 [143]----basic math operators
  429. 3800 w[178]eq[171]1
  430. 3802 e[178]0:z[178]0:c$[178]c$(j,w)
  431. 3804 [139]c$(j,w)[178]"+"[167] z[178]x[170]y:[142]
  432. 3805 [139]c$(j,w)[178]"++"[167] z[178]0:[129]h[178]x[164]y:z[178]z[170]buf(h):[130]h:[142]
  433. 3806 [139]c$(j,w)[178]"-"[167] z[178]x[171]y:[142]
  434. 3807 [139]c$(j,w)[178]"*"[167] z[178]x[172]y:[142]
  435. 3808 [139]c$(j,w)[178]"/"[175]y[179][177]0[167] z[178]x[173]y:[142]
  436. 3809 [139]c$(j,w)[178]"^"[167] z[178]x[174]y:[142]
  437. 3810 [139]c$(j,w)[178]"sgn"[167] z[178]y[172]([171]1):[142]
  438. 3811 [143]----logical operators
  439. 3812 [139]c$(j,w)[178]"="[175]x[178]y[167]z[178]1:[142]
  440. 3813 [139]c$(j,w)[178]"<"[175]x[179]y[167]z[178]1:[142]
  441. 3814 [139]c$(j,w)[178]">"[175]x[177]y[167]z[178]1:[142]
  442. 3815 [139]c$(j,w)[178]"<>"[175]x[179][177]y[167]z[178]1:[142]
  443. 3816 [139]c$(j,w)[178]"or"[175](x[177]1[176]y[177]1)[167]z[178]1:[142]
  444. 3817 [139]c$(j,w)[178]"and"[175]x[177]1[175]y[177]1[167]z[178]1:[142]
  445. 3818 [139]c$[178]"="[176]c$[178]"<"[176]c$[178]">"[176]c$[178]"<>"[176]c$[178]"or"[176]c$[178]"and"[167]z[178]0:[142]
  446. 3819 [143]----scientific operators
  447. 3820 [139]c$(j,w)[178]"sqr"[175]y[177][178]0[167] z[178][186](y):[142]
  448. 3821 [139]c$(j,w)[178]"sin"[167] z[178][191](y):[142]
  449. 3822 [139]c$(j,w)[178]"cos"[167] z[178][190](y):[142]
  450. 3824 [139]c$(j,w)[178]"tan"[175][190](y)[179][177]0[167] z[178][192](y):[142]
  451. 3826 [139]c$(j,w)[178]"atn"[167] z[178][193](y):[142]
  452. 3828 [139]c$(j,w)[178]"abs"[167] z[178][182](y):[142]
  453. 3830 [139]c$(j,w)[178]"log"[175]y[177]0[167] z[178][188](y):[142]
  454. 3832 [139]c$(j,w)[178]"exp"[175][182](y)[179]88[167] z[178][189](y):[142]
  455. 3834 [139]c$(j,w)[178]"int"[167] z[178][181](y):[142]
  456. 3836 [139]c$(j,w)[178]"sec"[175][190](y)[179][177]0[167] z[178]1[173][190](y):[142]
  457. 3838 [139]c$(j,w)[178]"csc"[175][191](y)[179][177]0[167] z[178]1[173][191](y):[142]
  458. 3840 [139]c$(j,w)[178]"cot"[175][192](y)[179][177]0[167] z[178]1[173][192](y):[142]
  459. 3842 [139]c$(j,w)[178]"asn"[175]([171]y[172]y[170]1)[177]0[167] z[178][193](y[173][186]([171]y[172]y[170]1)):[142]
  460. 3844 [139]c$(j,w)[178]"aco"[175]([171]y[172]y[170]1)[177]0[167] z[178][171][193](y[173][186]([171]y[172]y[170]1))[170]pi[173]2:[142]
  461. 3846 [139]c$(j,w)[178]"asc"[175](y[172]y[171]1)[177]0[167] z[178][193](y[173][186](y[172]y[171]1)):[142]
  462. 3848 [139]c$(j,w)[178]"acs"[175](y[172]y[171]1)[177]0[167] z[178][193](y[173][186](y[172]y[171]1))[170]([180](y)[171]1[172]pi[173]2):[142]
  463. 3850 [139]c$(j,w)[178]"act"[167] z[178][193](y)[170]pi[173]2:[142]
  464. 3852 [139]c$(j,w)[178]"inv"[175]y[179][177]0[167] z[178]1[173]y:[142]
  465. 3854 [143]----conversions
  466. 3856 [139]c$(j,w)[178]"rad"[167] z[178]y[172]pi[173]180:[142]
  467. 3858 [139]c$(j,w)[178]"deg"[167] z[178]y[172]180[173]pi:[142]
  468. 3860 [139]c$(j,w)[178]"ins"[167] z[178]y[173]25.4:[142]
  469. 3862 [139]c$(j,w)[178]"mms"[167] z[178]y[172]25.4:[142]
  470. 3864 [139]c$(j,w)[178]"dfr"[167] z[178]y[172]9[173]5[170]32:[142]
  471. 3866 [139]c$(j,w)[178]"dcg"[167] z[178](y[171]32)[172]5[173]9:[142]
  472. 3868 [139]c$(j,w)[178]"gms"[167] z[178]y[173].03536:[142]
  473. 3870 [139]c$(j,w)[178]"ozs"[167] z[178]y[172].03536:[142]
  474. 3872 [139]c$(j,w)[178]"lbm"[167] z[178]y[172]2.21:[142]
  475. 3874 [139]c$(j,w)[178]"kgm"[167] z[178]y[173]2.21:[142]
  476. 3876 [139]c$(j,w)[178]"lbf"[167] z[178]y[172]4.448:[142]
  477. 3878 [139]c$(j,w)[178]"nwf"[167] z[178]y[172].2248:[142]
  478. 3880 [139]c$(j,w)[178]"mls"[167] z[178]y[173]1.609344:[142]
  479. 3882 [139]c$(j,w)[178]"kms"[167] z[178]y[172]1.609344:[142]
  480. 3884 [139]c$(j,w)[178]"fps"[167] z[178]y[172].3048:[142]
  481. 3886 [139]c$(j,w)[178]"mps"[167] z[178]y[173].3048:[142]
  482. 3888 [139]c$(j,w)[178]"psi"[167] z[178]y[172]6.895[174]3:[142]
  483. 3890 [139]c$(j,w)[178]"nsm"[167] z[178]y[173]6.895[174]3:[142]
  484. 3892 [143] ifc$(j,w)="fn1"then z=y           :return:rem user defined function 1
  485. 3894 [143] ifc$(j,w)="fn2"then z=y           :return:rem user defined function 2
  486. 3896 [143] ifc$(j,w)="fn3"then z=y           :return:rem user defined function 3
  487. 3898 [153]" definvalid parametersyson":z[178]0:e[178]1
  488. 3900 [142]
  489. 3902 [143]----currency/decimal/right justification
  490. 3904 r[178]2:[137]3908
  491. 3906 r[178][197]([202](c$(j,0),2))
  492. 3908 clm$[178][196]([181]([197](clm$)[172]10[174]r[170].5))
  493. 3910 [139][200](clm$,1)[178]" "[167]clm$[178][202](clm$,2)
  494. 3912 [139]r[177][195](clm$)[167]clm$[178][201]("00000000"[170]clm$,r)
  495. 3914 [139]r[167]clm$[178][200](clm$,[195](clm$)[171]r)[170]"."[170][201](clm$,r)
  496. 3916 [143]----right justify
  497. 3918 [139][195](clm$)[179]cw[167]clm$[178][201](s$[170]clm$,cw)
  498. 3920 [139][195](clm$)[177]cw[167]clm$[178][200](clm$,cw)
  499. 3922 [142]
  500. 3924 [143]----left justification
  501. 3926 [139][195](clm$)[179]cw[167]clm$[178]clm$[170][200](s$,cw[171][195](clm$))
  502. 3928 [139][195](clm$)[177]cw[167]clm$[178][200](clm$,cw)
  503. 3930 [142]
  504. 3932 [143]----percent/right justification
  505. 3934 clm$[178][196]([197](clm$)[172]100)
  506. 3936 [137]3906
  507. 3938 [143]----directory
  508. 3940 [153]"loadsys";:@"$":[153][163]25)"printpress any keywaitsys":[141]3018:[142]
  509. 3998 [143]----setup for printer
  510. 4000 [153]"loadsys      calculated reports program       "
  511. 4002 [153]"   printer or interface configuration  "
  512. 4003 [153]"print current option is:sys"p
  513. 4004 [153]"print press 1printwait  cardco a, 1525
  514. 4006 print"       2[153][146]  printers w/graphic interfaces"
  515. 4008 print"       3[153][146]  1526, mps801/802/803"
  516. 4009 print"       4[153][146]  print to screen"
  517. 4010 ifp<>0thenprint"   or  s[153][146]end printer commands"
  518. 4012 ifp<>othenprint"       e[153][146]xit to continue"
  519. 4014 print"[158]       press the appropriate key      "
  520. 4016 geta$:ifa$=""then4016
  521. 4018 ifa$="e"thenprint"[147]clearing...":return
  522. 4020 ifa$="s"then4044
  523. 4022 p=val(a$):pf=4
  524. 4024 ifp=1thenb1$=chr$(10):goto4000
  525. 4026 ifp=2thenb1$=chr$(0):goto4000
  526. 4028 ifp=3thenb1$=chr$(0):goto4000
  527. 4029 ifp=4thenb1$=chr$(0):pf=3:goto4000
  528. 4030 gosub602:goto4016
  529. 4032 rem----print terminator
  530. 4034 onpgoto4036,4038,4040,4038
  531. 4036 print#pf,b1$;:return
  532. 4038 print#pf,b1$:return
  533. 4040 print#pf:return
  534. 4042 rem----printer commands
  535. 4044 print"[147] [158]           printer command            [146]"
  536. 4046 print"[153] this routine will send character"
  537. 4048 print" string [chr$()] commands to an ascii"
  538. 4050 print" printer.  commands must be entered in"
  539. 4052 print" the form of integers such as:"
  540. 4054 print"[158] ? 27[153]     (escape code)"
  541. 4056 print" [158]? 66[153]     (pitch code)"
  542. 4058 print" [158]? 2[153]      (compressed mode)"
  543. 4060 print" [158]? *[153]      (end the sequence)"
  544. 4062 print" this will be sent to the printer as:"
  545. 4064 print"   [158]print#4,chr$(27)chr$(66)chr$(2)[153]"
  546. 4066 print" up to four(4) numbers may be sent,"
  547. 4068 print" the first normally being [158]27[153][146], the"
  548. 4070 print" escape character.  end the sequence"
  549. 4072 print" by pressing return[153][146] when the asterisk"
  550. 4074 print" is showing.  printers will vary, so"
  551. 4076 print" check your manual for the codes."
  552. 4078 print"    any key[153][146] to continue or e[153][146]xit?[158]"
  553. 4079 geta$:ifa$=""then4079
  554. 4080 ifa$="e"thenreturn
  555. 4082 print"[147] [158]        send printer command          [146]"
  556. 4084 print" [153]enter code, then press return[146]"
  557. 4086 print" return[146] [153]only to quit"
  558. 4088 fori=1to4:print"[153]code[158]";i;" ? * [157][157][157][157]";:inputi$(i)
  559. 4090 ifi$(i)="*"then4094
  560. 4092 nexti
  561. 4094 on(i-1)goto4096,4098,4100,4102:goto4104
  562. 4096 print#4,chr$(val(i$(1))):goto4104
  563. 4098 print#4,chr$(val(i$(1)))chr$(val(i$(2))):goto4104
  564. 4100 print#4,chr$(val(i$(1)))chr$(val(i$(2)))chr$(val(i$(3))):goto4104
  565. 4102 print#4,chr$(val(i$(1)))chr$(val(i$(2)))chr$(val(i$(3)))chr$(val(i$(4)))
  566. 4104 print"          a[153][146]nother code"
  567. 4106 print"          t[153][146]est printer"
  568. 4108 print"          e[153][146]xit to print"
  569. 4110 print" [158]      press the appropriate key       "
  570. 4112 geta$:ifa$=""then4112
  571. 4113 ifa$="a"then4082
  572. 4114 ifa$="t"thenprint#4,"abcdefghijklmnopqrstuvwxyz":goto4112
  573. 4116 ifa$="e"thenreturn
  574. 4118 gosub602:goto4112
  575.