home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 80 / 080.d81 / emp exp (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1991-01-01  |  10.0 KB  |  381 lines

  1. 1 fori=49152to49270:readj:pokei,j:next
  2. 2 data 032,204,255,169,002,162,112
  3. 3 data 160,192,032,189,255,169,001
  4. 4 data 162,008,160,000,032,186,255
  5. 5 data 032,192,255,162,001,032,198
  6. 6 data 255,032,207,255,032,207,255
  7. 7 data 032,207,255,032,207,255,165
  8. 8 data 144,201,000,208,043,032,099
  9. 9 data 192,032,207,255,141,115,192
  10. 10 data 032,207,255,141,114,192,173
  11. 11 data 114,192,174,115,192,032,205
  12. 12 data 189,032,207,255,208,008,169
  13. 13 data 013,032,210,255,076,035,192
  14. 14 data 032,210,255,076,071,192,169
  15. 15 data 001,032,195,255,032,204,255
  16. 16 data 096,160,000,169,032,032,210
  17. 17 data 255,200,192,006,208,248,096
  18. 18 data 036,048,000,000,153,153,151
  19. 19 nc=11:nf=5
  20. 20 poke53281,0:poke53280,11:printchr$(8);chr$(14)
  21. 40 n=0:dima$(200,25),fd$(nf),c$(25),m$(10),df$(7),tp$(25)
  22. 42 fori=1to10:readm$(i):next
  23. 43 data "[204]oad [198]ile     ","[211]ave [198]ile     ","[193]dd [210]ecord    ","[195]hange [210]ecord "
  24. 44 data "[196]elete [210]ecord ","[196]isplay [198][201]le  ","[208]rint [198]ile    ","# [210]ecords     "
  25. 45 data "[196]isk [198]unctions","[197]xit          "
  26. 46 fori=1to7:readdf$(i):next
  27. 47 data "[214]iew [196]irectory   ","[211]cratch [198]ile     ","[210]ename [198]ile      "
  28. 48 data "[197]rror [211]tatus     ","[198]ormat [196]isk      "
  29. 49 data "[214]alidate [196]isk    ","[210]eturn to [208]rogram"
  30. 50 fori=1tonf:readfd$(i):next
  31. 60 fori=1tonc:readc$(i):next
  32. 80 sp$="                           "
  33. 90 print"[147][154]            [197]mployee [197]xpenses           "
  34. 100 fori=1to10:printtab(13)""m$(i):next
  35. 101 gosub3600
  36. 105 r=4:m=1:poke214,r:print:printtab(13)"[153]"m$(m):r1=r:m1=m
  37. 110 getk$:ifk$=""then110
  38. 111 ifk$=chr$(13)then240
  39. 115 ifk$=""thenr=r+1:m=m+1:ifm=11thenm=1:r=4
  40. 120 ifk$="[145]"thenr=r-1:m=m-1:ifm=0thenm=10:r=13
  41. 125 poke214,r1:print:printtab(13)""m$(m1)
  42. 130 poke214,r:print:printtab(13)"[153]"m$(m)
  43. 135 r1=r:m1=m:goto110
  44. 240 onmgosub270,1400,440,530,640,790,960,1330,1590,4000
  45. 250 ifm=10then110
  46. 255 goto90
  47. 260 :
  48. 270 print"[147][154]                [204]oad [198]ile               "
  49. 280 print"[198]ilename: ";
  50. 290 l=15:ty=4:gosub3210:iff3thenreturn
  51. 300 fl$=v$:print
  52. 310 open15,8,15,"io"
  53. 320 open2,8,2,"0:"+fl$+",s,r"
  54. 330 input#15,e,e$,e1,e2
  55. 340 print"[150][196]isk [211]tatus:"e;e$;e1;e2
  56. 350 ifethenclose2:close15:print"[198]ile [206]ot [204]oaded":gosub2310:return
  57. 360 input#2,n
  58. 370 fori=1ton
  59. 380 forj=1tonf
  60. 390 input#2,a$(i,j)
  61. 400 next:next
  62. 410 close2:close15
  63. 420 return
  64. 430 :
  65. 440 n=n+1:x=n
  66. 450 print"[147][154]               [193]dd [210]ecord               "
  67. 460 gosub2470
  68. 470 iff3thenn=n-1:return
  69. 480 print"[154]        [205]ore? [y/n]"
  70. 490 getk$:ifk$=""then490
  71. 500 ifk$="y"then440
  72. 510 return
  73. 520 :
  74. 530 print"[147][154]              [195]hange [210]ecord             "
  75. 540 gosub3420:ifflthenreturn
  76. 550 fl=0:f=3
  77. 560 print"[150][210]ecord # to change: ";
  78. 570 ty=2:l=3:gosub3210:x=val(v$)
  79. 580 iff3thenreturn
  80. 585 ifx>nthenreturn
  81. 590 gosub2240:iffl=1thenreturn
  82. 595 fori=1tonc:tp$(i)=a$(x,i):next
  83. 600 gosub3400:print"":gosub2470
  84. 610 iff3thenfori=1tonc:tp$(i)=a$(x,i):next
  85. 620 return
  86. 630 :
  87. 640 print"[147][154]              [196]elete [210]ecord             "
  88. 650 gosub3420:ifflthenreturn
  89. 660 fl=0:f=3
  90. 670 print"[150][210]ecord # to delete: ";
  91. 680 ty=2:l=3:gosub3210:x=val(v$)
  92. 690 iff3thenreturn
  93. 695 ifx>nthenreturn
  94. 700 gosub2240:iffl=1thenreturn
  95. 710 n=n-1
  96. 720 fori=xton
  97. 730 forj=1tonf
  98. 740 a$(i,j)=a$(i+1,j)
  99. 750 next:next
  100. 760 printtab(12)">[210]ecord deleted<"
  101. 770 gosub2310:return
  102. 780 :
  103. 790 print"[147][154]              [196]isplay [198]ile              "
  104. 800 gosub3420:ifflthenreturn
  105. 810 r=0:f=0:tl=0:gosub2620
  106. 820 iff3thenreturn
  107. 830 print"[147][154]              [196]isplay [198]ile              "
  108. 840 ifr=2andf$<>a$(s,1)then920
  109. 850 gosub3400:print""
  110. 860 print"     [210]ecord #:"s
  111. 870 printfd$(1);a$(s,1);" ";c$(val(a$(s,1)))
  112. 880 fork=2tonf:printfd$(k);a$(s,k):next
  113. 890 tl=tl+val(a$(s,5)):v=tl:gosub2870
  114. 900 print"[150]    [195]um [212]otal:[146] "xx$
  115. 910 gosub2380:iff3thenreturn
  116. 920 s=s+1:ifs<=ethen840
  117. 930 printtab(13)">[197]nd of file<"
  118. 940 gosub2310:return
  119. 950 :
  120. 960 print"[147][154]               [208]rint [198]ile               "
  121. 970 gosub3420:ifflthenreturn
  122. 980 r=0:f=0:tl=0:gosub2620
  123. 990 iff3thenreturn
  124. 1000 print"[153][208]rinter ready? [y/n]"
  125. 1010 getk$:ifk$=""then1010
  126. 1020 ifk$<>"y"thenreturn
  127. 1030 print"[154][208]rinting..."
  128. 1040 open2,4,7:cmd2
  129. 1050 printtab(5)"-------------------------------------------------------------";
  130. 1060 print"-----------"
  131. 1070 printtab(5)":                         [197]mployee [197]xpenses                 ";
  132. 1080 print"           :"
  133. 1090 printtab(5)"-------------------------------------------------------------";
  134. 1100 print"-----------"
  135. 1110 printtab(5)":  [195]ategory"spc(7)"[196]ate"spc(4)"[195]heck #"spc(2)"[196]escription";
  136. 1120 printspc(17);"[193]mount  :"
  137. 1130 printtab(5)"------------------------------------------------------------";
  138. 1140 print"------------"
  139. 1150 fori=stoe
  140. 1160 ifr=2andf$<>a$(i,1)then1240
  141. 1170 cg=val(a$(i,1))
  142. 1180 printtab(5);":  ";left$(c$(cg)+sp$,13);spc(2);
  143. 1190 printleft$(a$(i,2)+sp$,6);spc(2);
  144. 1200 printright$(sp$+a$(i,3),7);spc(2);
  145. 1210 printleft$(a$(i,4)+sp$,20);spc(1);
  146. 1220 printright$(sp$+"$"+a$(i,5),13);"  :"
  147. 1230 tl=tl+val(a$(i,5))
  148. 1240 next
  149. 1250 v=tl:gosub2870
  150. 1260 printtab(5)"-------------------------------------------------------------";
  151. 1270 print"-----------"
  152. 1280 printspc(5)":";spc(28)"[212]otal: $"xx$;spc(34-len(xx$));":"
  153. 1290 printtab(5)"------------------------------------------------------------";
  154. 1300 print"------------"
  155. 1310 print#2:close2:return
  156. 1320 :
  157. 1330 print"[147][154]                # [210]ecords               "
  158. 1340 print"  # [210]ecords:";n
  159. 1350 fm=peek(51)+256*peek(52)-peek(49)-peek(50)*256
  160. 1360 print"[198]ree [205]emory:";fm
  161. 1370 gosub2310
  162. 1380 return
  163. 1390 :
  164. 1400 print"[147][154]                [211]ave [198]ile               "
  165. 1410 gosub3420:ifflthenreturn
  166. 1420 print"[195]urrent [198]ilename: "fl$
  167. 1430 print"        [198]ilename: ";
  168. 1440 l=15:ty=4:gosub3210:iff3thenreturn
  169. 1450 fl$=v$:print
  170. 1460 open15,8,15,"io"
  171. 1470 open2,8,2,"@0:"+fl$+",s,w"
  172. 1480 input#15,e,e$,e1,e2
  173. 1490 print"[150][196]isk [211]tatus:"e;e$;e1;e2
  174. 1500 ifethenclose2:close15:print"[198]ile [206]ot [211]aved.":gosub2310:return
  175. 1510 print#2,n
  176. 1520 fori=1ton
  177. 1530 forj=1tonf
  178. 1540 print#2,a$(i,j)
  179. 1550 next:next
  180. 1560 close2:iff1=0thenclose15
  181. 1570 return
  182. 1580 :
  183. 1590 print"[147][154]             [196]isk [198]unctions             "
  184. 1600 fori=1to7:printtab(12)""df$(i):next
  185. 1601 gosub3600
  186. 1605 r=4:m=1:poke214,r:print:printtab(12)"[150]"df$(m):r1=r:m1=m
  187. 1610 getk$:ifk$=""then1610
  188. 1620 ifk$=chr$(13)then1690
  189. 1625 ifk$=""thenr=r+1:m=m+1:ifm=8thenm=1:r=4
  190. 1630 ifk$="[145]"thenr=r-1:m=m-1:ifm=0thenm=7:r=10
  191. 1635 poke214,r1:print:printtab(12)""df$(m1)
  192. 1640 poke214,r:print:printtab(12)"[150]"df$(m)
  193. 1645 r1=r:m1=m:goto1610
  194. 1690 ifm=7thenreturn
  195. 1700 onmgosub1730,1780,1880,1960,2030,2150
  196. 1710 goto1590
  197. 1720 :
  198. 1730 print"[147]             [214]iew [196]irectory             "
  199. 1740 sys49152
  200. 1750 gosub2310
  201. 1760 return
  202. 1770 :
  203. 1780 print"[147]              [211]cratch [198]ile              "
  204. 1790 print"[198]ilename: ";
  205. 1800 ty=4:l=15:gosub3210
  206. 1810 ifv$=chr$(0)thenreturn
  207. 1820 print:print"[193]re you sure?"
  208. 1830 getk$:ifk$=""then1830
  209. 1840 ifk$<>"y"thenreturn
  210. 1850 open15,8,15,"s0:"+v$:close15
  211. 1860 return
  212. 1870 :
  213. 1880 print"[147]              [210]ename [198]ile               "
  214. 1890 print"[207]ld [198]ilename: ";:ty=4:l=15:gosub3210:f1$=v$
  215. 1900 ifv$=chr$(0)thenreturn
  216. 1910 print:print"[206]ew [198]ilename: ";:ty=4:l=15:gosub3210:f2$=v$
  217. 1920 ifv$=chr$(0)thenreturn
  218. 1930 open15,8,15,"r0:"+f2$+"="+f1$:close15
  219. 1940 return
  220. 1950 :
  221. 1960 print"[147]             [196]isk [211]tatus                "
  222. 1970 open15,8,15
  223. 1980 input#15,e,e$,e1,e2:close15
  224. 1990 print"[196]isk [211]tatus: "e;e$;e1;e2
  225. 2000 gosub2310
  226. 2010 return
  227. 2020 :
  228. 2030 print"[147]              [198]ormat [196]isk               "
  229. 2040 print"[150][201]nsert disk to be formatted."
  230. 2050 print"[196]isk name: ";:ty=4:l=15:gosub3210:dn$=v$
  231. 2060 ifv$=chr$(0)thenreturn
  232. 2070 print:print"[196]isk [201][196]: ";:ty=3:l=2:gosub3210:di$=v$
  233. 2080 ifv$=chr$(0)thenreturn
  234. 2090 print:print"[193]re you sure?"
  235. 2100 getk$:ifk$=""then2100
  236. 2110 ifk$<>"y"thenreturn
  237. 2120 open15,8,15,"n0:"+dn$+","+di$:close15
  238. 2130 return
  239. 2140 :
  240. 2150 print"[147]             [214]alidate [196]isk              "
  241. 2160 print"[208]ress [153][198]7 to validate, any key to exit"
  242. 2170 getk$:ifk$=""then2170
  243. 2180 ifk$<>chr$(136)thenreturn
  244. 2190 print"[154][214]alidating..."
  245. 2200 open15,8,15,"v0":close15
  246. 2210 return
  247. 2220 :
  248. 2230 :
  249. 2240 print:printtab(2)fd$(1);" ";a$(x,1);" ";c$(val(a$(x,1)))
  250. 2250 fori=2tonf:printtab(2)fd$(i);" ";a$(x,i):next
  251. 2260 print"[150][201]s this the record? [y/n]"
  252. 2270 getk$:ifk$<>"y"andk$<>"n"then2270
  253. 2280 ifk$="y"thenreturn
  254. 2290 fl=1:return
  255. 2300 :
  256. 2310 printtab(8)"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  257. 2320 printtab(8)"[221] [154][208]ress [153][198]7 [154]to continue [221]"
  258. 2330 printtab(8)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  259. 2340 getk$:ifk$=""then2340
  260. 2350 ifk$<>chr$(136)then2340
  261. 2360 return
  262. 2370 :
  263. 2380 f3=0
  264. 2390 print" [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  265. 2400 print" [221] [153][210][197][212][213][210][206] [154]to continue.   [153][198]7 [154] to exit. [221]"
  266. 2410 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  267. 2420 getk$:ifk$=""then2420
  268. 2430 ifk$<>chr$(136)andk$<>chr$(13)then2420
  269. 2440 ifk$=chr$(136)thenf3=1
  270. 2450 return
  271. 2460 :
  272. 2470 gosub3450:print"     [210]ecord #:"x
  273. 2480 fori=1tonf:printfd$(i):next:print"[145][145][145][145][145][145]"
  274. 2490 printtab(15);:ty=2:l=2:gosub3210:a$(x,1)=v$:iff3thenreturn
  275. 2500 v=val(v$):ifv<1or v>ncthenprint"[147]":goto2470
  276. 2510 printtab(15);:ty=4:l=6:gosub3210:a$(x,2)=v$:iff3thenreturn
  277. 2520 printtab(15);:ty=4:l=6:gosub3210:a$(x,3)=v$:iff3thenreturn
  278. 2530 printtab(15);:ty=4:l=20:gosub3210:a$(x,4)=v$:iff3thenreturn
  279. 2540 printtab(15);:ty=2:l=11:gosub3210:a$(x,5)=v$:iff3thenreturn
  280. 2550 print"[150]      [195]orrect [y/n]"
  281. 2560 getk$:ifk$=""then2560
  282. 2570 ifk$="n"thenprint"[147]":goto2470
  283. 2580 ifk$=chr$(13)thenf3=1:return
  284. 2590 v=val(a$(x,5)):gosub2870:a$(x,5)=xx$
  285. 2600 return
  286. 2610 :
  287. 2620 print"[147][154]           [208]rint/[196]isplay [198]iles          ":s=1:e=n:f3=0
  288. 2630 printtab(5)"1]  [193]ll records
  289. 2640 [153][163]5)"2]  peeky category
  290. 2650 getr$:ifr$=""then2650
  291. 2660 ifr$=chr$(13)thenf3=1:return
  292. 2670 r=val(r$):ifr<1orr>2then2650
  293. 2680 ifr=1then2780
  294. 2690 gosub3400:print""
  295. 2700 remfori=1tonc
  296. 2710 gosub3450
  297. 2720 printtab(5)"[195]ategory: ";
  298. 2730 l=2:ty=2:gosub3210
  299. 2740 iff3thenf3=1:return
  300. 2750 f=val(v$):iff<1orf>ncthen2620
  301. 2760 f$=v$:return
  302. 2770 :
  303. 2780 print"[212]here are"n"records in this file."
  304. 2790 print"start record #:    [157][157][157]";:ty=4:l=3:gosub3210:s=val(v$)
  305. 2800 iff3thenf3=1:return
  306. 2810 ifs<1ors>nthenprint"[145][145][145]":goto2780
  307. 2820 print"  end record #:    [157][157][157]"; :ty=4:l=3:gosub3210:e=val(v$)
  308. 2830 iff3thenf3=1:return
  309. 2840 ife<sore>nthenprint"[145][145]":goto2820
  310. 2850 return
  311. 2860 :
  312. 2870 x$="":xx$=""
  313. 2880 vv=int(v*10^(3)):x$=str$(vv)
  314. 2890 ifval(right$(x$,1))>4thenvv=vv+10
  315. 2900 x$=str$(vv):l=len(x$):ifl>4then2940
  316. 2910 xx$="0.":ifl=4then2930
  317. 2920 forj=1to(4-l):xx$=xx$+"0":next
  318. 2930 xx$=xx$+mid$(x$,2,l-2):goto2950
  319. 2940 xx$=xx$+mid$(x$,2,l-4)+"."+mid$(x$,l-2,2)
  320. 2950 return
  321. 2960 :
  322. 2970 data "   [195]ategory #: ","         [196]ate: ","      [195]heck #: "
  323. 2980 data "  [196]escription: ","       [193]mount: "
  324. 2990 data "[193]uto-[199]as","[193]uto-[210]epair","[193]uto-[201]nsur","[193]uto-[210]ental","[193]uto-[212]olls"
  325. 3000 data "[193]uto-[208]kg","[204]odgings","[205]eals","[212]ransport","[197]ntertainment"
  326. 3001 data "[207]ther"
  327. 3010 :
  328. 3210 v$="":k$="":ct=0:print"[164][157]";:f3=0
  329. 3220 k$="":getk$:ifk$=""then3220
  330. 3230 ifk$=chr$(13)then3360:rem return
  331. 3240 ifk$=chr$(20)andct<>0thenprint" [157][157][164][157]";:ct=ct-1:v$=left$(v$,ct):goto3220
  332. 3250 ifk$=" "then3330:rem space
  333. 3260 ifty=1or ty>2thenif(k$>"@")and(k$<"[")then3330:rem alpha
  334. 3270 ifty>1thenif(k$>"/")and(k$<":")then3330:rem numeric
  335. 3280 ifty=2thenifk$="."then3330
  336. 3290 ifty=1orty>2thenif(k$>"[192]")and(k$<"[219]")then3330:rem upper case
  337. 3300 ifty=4thenif(k$>" ")and(k$<"0")then3330:rem !"#$%&'()*+,-./ punctuation
  338. 3310 [139]ty[178]4[167][139](k$[177]"9")[175](k$[179]"@")[167]3330:[143] :;<=>? punctuation
  339. 3320 [137]3220
  340. 3330 [139]ct[177][178]l[167]3220
  341. 3340 ct[178]ct[170]1:v$[178]v$[170]k$:[153]k$;:[151]212,0:[153]"tocmd";
  342. 3350 [137]3220
  343. 3360 [139]ct[178]0[167]v$[178][199](0):f3[178]1
  344. 3370 [143]fori=len(v$)+1tol:v$=v$+" ":next:rem pad string
  345. 3380 [153]" ":[142]
  346. 3390 :
  347. 3400 [129]j[178]1[164]10:[151]781,j:[158]59903:[130]:[142]
  348. 3410 :
  349. 3420 fl[178]0:[139]n[179]1[167]fl[178]1
  350. 3430 [139]fl[167][153]"(NULL)o file in memory.":[141]2310
  351. 3440 [142]
  352. 3450 [153][163]2)"printortantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan^"
  353. 3460 [153][163]2)"(NULL)            contlenategoriesprint            (NULL)"
  354. 3470 [153][163]2)"-tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan<"
  355. 3480 [153][163]2)"(NULL)  1 atnuto-chr$as       2 atnuto-(NULL)epairs print(NULL)"
  356. 3490 [153][163]2)"(NULL)  3 atnuto-right$nsurance 4 atnuto-(NULL)ental  print(NULL)"
  357. 3500 [153][163]2)"(NULL)  5 atnuto-(NULL)arking   6 atnuto-(NULL)olls   print(NULL)"
  358. 3505 [153][163]2)"(NULL)  7 (NULL)odgings       8 (NULL)eals        print(NULL)"
  359. 3506 [153][163]2)"(NULL)  9 (NULL)ransport     10 valntertaining print(NULL)"
  360. 3507 [153][163]2)"(NULL) 11 (NULL)ther                         print(NULL)"
  361. 3510 [153][163]2)"/tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantanexpcont"
  362. 3520 [142]
  363. 3530 :.
  364. 3600 [151]214,20:[153]
  365. 3605 [153]" ortantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan^"
  366. 3610 [153]" (NULL)  cont(NULL)se len(NULL)(NULL)(NULL)(NULL)(NULL) keys/(NULL)val(NULL)(NULL)(NULL)(NULL) to select. (NULL)"
  367. 3615 [153]" /tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantantanexp"
  368. 3620 [142]
  369. 3625 :
  370. 4000 [151]214,17:[153]:[153][163]11)"defatnre you sure? [y/n]
  371. 4005 getk$:ifk$=""then4005
  372. 4010 ifk$<>"y"thenprint"[145]                                  ":return
  373. 4015 open15,8,15,"r0:tax boot=tax boot"
  374. 4020 input#15,er%:close15
  375. 4025 ifer%<>63thenprint"[147]":end
  376. 4030 poke646,peek(53281)
  377. 4035 print"[147]load"chr$(34)"tax boot"chr$(34)",8"
  378. 4040 print"run"
  379. 4045 poke631,13:poke632,13:poke633,13:poke198,3:end
  380. 10000 open15,8,15,"s0:emp exp":close15:save"0:emp exp",8
  381.