home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 133 / 133.d81 / uf (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  281 lines

  1. 100 rem utilities file 64  copyright 1995   v1.0  by d.b. dumler 01/11/95
  2. 110 clr:mt=49152:dv=peek(186):ifdv<8thendv=8
  3. 115 ifpeek(762)<>192thenload"pt.ml",dv,1
  4. 120 d=dv:ifpeek(999)<>101thenload"dir.ml",dv,1
  5. 125 sys57812"menubox c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
  6. 130 e=12:dimm$(e),el(e),kw(e),bp(e),ld(e),wa(e),ga(e),gs(e),cf(e),pt$(9)
  7. 140 a=211:b=988:m=24:s=54272:printchr$(14);chr$(8):poke965,24
  8. 150 sp$="":fori=1to80:sp$=sp$+" ":next
  9. 160 p4=1:open15,dv,15:open8,dv,8,"config.data":gosub2180:iferthenclose8:goto40000
  10. 170 input#8,nn$,ce,d,rt,p,sa,p1,p2,p3,p4,p5:nn$="  ":fori=1to9:pt$(i)=" "
  11. 180 get#8,b$:ifb$=""thenb$=chr$(.)
  12. 190 remifb$<>chr$(13)thenpt$(i)=pt$(i)+b$:goto180
  13. 200 next:close8:fori=1toe:readm$(i):next
  14. 210 poke830,d:n1$="0:util.data "
  15. 220 v=13*4096:hx=80:hy=126:ch=1:poke2040,11:pokev+21,.:pokev+39,p3
  16. 230 bo=06:bk=00:tx=03:gosub1970:print"[147]","  ";
  17. 240 i=700:mm=peek(i):dd=peek(i+1):yy=peek(i+2):goto300
  18. 250 ifrt=.then290
  19. 260 dz=rt:gosub2260:if(er>.)and(er<>73)thenrt=.:dz=dv:gosub2260:goto290
  20. 270 print#15,"t-rd":get#15,yy$,yy$,mm$,dd$:dz=dv:gosub2260
  21. 280 yy=asc(yy$):mm=asc(mm$):dd=asc(dd$):goto300
  22. 290 gosub3100:sysb,5,10,"[197]nter today's date:":gosub1900:print"",
  23. 291 forjj=0to8:poke631+jj,asc("[157]"):next:poke198,9
  24. 292 sysmt+66,tx,1,8,"[205][205]/[196][196]/[217][217]":mm=val(mid$(w$,1,2)):dd=val(mid$(w$,4,2))
  25. 294 yy=val(mid$(w$,7,2))
  26. 300 if(mm<1)or(mm>e)or(dd<1)or(dd>31)or(yy<.)or(yy>99)then250
  27. 310 mm$=str$(mm):dd$=str$(dd):yr$=right$(str$(ce+yy),4)
  28. 320 pokei,mm:pokei+1,dd:pokei+2,yy
  29. 330 dz=d:gosub2170:if(er>.)and(er<>73)then330
  30. 340 bo=14:bk=00:tx=03:gosub1970
  31. 350 gosub1980:gosub2420:print"[145]"tab(nt)nn$
  32. 360 print,"    - [205][193][201][206] [205][197][206][213] -
  33. 370 [153]," 1 ascetch data":[153]," 2 (NULL)ave data
  34. 380 print," 3 [197]dit data":ifmuthenprinttab(25)"[145]- "m$(mu)" "yr$
  35. 390 print," 4 [196]isplay data":print," 5 [208]rint hardcopy
  36. 400 [153]," 6 (NULL)un (NULL)(NULL)right$(NULL)right$(NULL)right$val(NULL) chr$(NULL)atn(NULL)left$ 64"
  37. 405 [153]," 7 valxit program":[141]1900:[141]2010
  38. 410 [139]ch[178].[167]hy[178]126:ch[178]1:[137]350
  39. 420 bk[178]00:tx[178]03:[151]v[170]21,.
  40. 430 [145]ch[137]560,640,730,1020,1530,470,440
  41. 440 [141]3300:[153]"(NULL)uit?  atnre you sure? ((NULL)/(NULL))":[141]3000:q$[178]jj$
  42. 450 [139]q$[179][177]"y"[167]hy[178]126:ch[178]1:[137]350
  43. 460 [137]40000
  44. 470 n3$[178]"(NULL)(NULL)right$(NULL)right$(NULL)right$val(NULL) chr$(NULL)atn(NULL)left$ 64":n4$[178]"ug"
  45. 480 [141]3300:[153]"right$s the "n3$" disk":[153]"in drive"dv;
  46. 490 [153]"((NULL)/(NULL))":[141]3000:q$[178]jj$:[139]q$[179][177]"y"[167]340
  47. 500 dz[178]dv:[141]2170:[139]er[167]330
  48. 510 [159]8,dv,8,n4$[170]",p,r":[160]8:[141]2180:[139]er[167]330
  49. 520 [153]"load":[158]b,e,10,"left$ang on ...":[153],"(NULL)oading: "n3$
  50. 530 [151]646,[194](53281):[153]"load"[199](34)n4$[199](34)","dv:[153]"run
  51. 540 fori=631to634:pokei,13:next:poke198,4
  52. 550 close15:end
  53. 560 bo=6:gosub1970
  54. 570 gosub1980:print,"   - [198][197][212][195][200] [196][193][212][193] -":gosub2290
  55. 575 onngoto580,340,570,570
  56. 580 open4,d,4,n1$+yf$+",s,r":gosub2180:iferthen630
  57. 590 i=1:sysb,m,8,"[145][145][145][145] [198]etching: [213]tilities "yu$" [146][145]
  58. 600 [132]4,el(i),kw(i),bp(i),ld(i),wa(i),ga(i),gs(i),cf(i)
  59. 610 [139]st[178].[167]i[178]i[170]1:[158]679:[137]600
  60. 620 mu[178]i:yr$[178]yu$
  61. 630 [160]4:[141]2180:[137]560
  62. 640 bo[178]4:[141]1970
  63. 650 [141]1980:[153],"    - (NULL)atn(NULL)val str$atn(NULL)atn -
  64. 660 ifmu<1thenx=4:w$="utilities datato save!":gosub2000:goto340
  65. 670 gosub2290:onngoto680,340,650,650
  66. 680 print#15,"s"+n1$+yf$:open4,d,4,n1$+yf$+",s,w"
  67. 690 sysb,m,8,"[145][145][145][145] [211]aving: [213]tilities "yu$" [146][145]":fori=1tomu
  68. 700 print#4,el(i):print#4,kw(i):print#4,bp(i):print#4,ld(i):print#4,wa(i)
  69. 710 print#4,ga(i):print#4,gs(i):print#4,cf(i):sys679:next:yr$=yu$
  70. 720 close4:gosub2180:goto640
  71. 730 bo=8:gosub1970
  72. 740 gosub1980:print,"    - [197][196][201][212] [196][193][212][193] -
  73. 750 [139]mu[167][153],"     (NULL)hrough "m$(mu)
  74. 760 [153],"1. atndd":[153],"2. lenhange":[153],"3. 'str$right$(NULL)(NULL)(NULL)atn(NULL) str$atn(NULL)atn' (NULL)val(NULL)(NULL)
  75. 770 print,"4. [205][193][201][206] [205][197][206][213]
  76. 780 [141]2450:[139]n[179]1[176]n[177]4[167][153]"on":[137]780
  77. 790 [145]n[137]830,800,1020,340
  78. 800 [139]mu[179]1[167]x[178]3:w$[178]"utilities datato change!":[141]2000:[137]740
  79. 810 [141]3300:[153]"(NULL)hich month? (1-12): ";:[158]mt[170]66,tx,1,2,[196](mu):i[178][197](w$)
  80. 815 [141]3310:[139]i[179]1[176]i[177]mu[167]810
  81. 820 [137]850:[143] gosub2460:goto850
  82. 830 [139]mu[178]e[167][153],"cmdcmd(NULL)he file is full already !":bz[178]1:[141]2220:[137]740
  83. 840 i[178]mu[170]1:mu[178]i:[141]3300:[153]m$(i)
  84. 845 [141]3310
  85. 850 [153]"vallectricity cost: ";:[158]mt[170]66,tx,1,7,[196](el(i)):el(i)[178][197](w$)
  86. 860 [141]3310:[139]el(i)[179].[167]850
  87. 870 [153]"(NULL)ilowatt-hours used: ";:[158]mt[170]66,tx,1,7,[196](kw(i)):kw(i)[178][197](w$)
  88. 880 [141]3310:[139]kw(i)[179].[167]870
  89. 890 [153]"(NULL)ocal phone cost: ";:[158]mt[170]66,tx,1,7,[196](bp(i)):bp(i)[178][197](w$)
  90. 900 [141]3310:[139]bp(i)[179].[167]890
  91. 910 [153]"(NULL)ong dist service cost: ";:[158]mt[170]66,tx,1,7,[196](ld(i)):ld(i)[178][197](w$)
  92. 920 [141]3310:[139]ld(i)[179].[167]910
  93. 930 [153]"(NULL)ater & sewer cost: ";:[158]mt[170]66,tx,1,7,[196](wa(i)):wa(i)[178][197](w$)
  94. 940 [141]3310:[139]wa(i)[179].[167]930
  95. 950 [153]"chr$allons of water used: ";:[158]mt[170]66,tx,1,7,[196](ga(i)):ga(i)[178][197](w$)
  96. 960 [141]3310:[139]ga(i)[179].[167]950
  97. 970 [153]"(NULL)atural gas cost: ";:[158]mt[170]66,tx,1,7,[196](gs(i)):gs(i)[178][197](w$)
  98. 980 [141]3310:[139]gs(i)[179].[167]970
  99. 990 [153]"chr$as cubic ft used: ";:[158]mt[170]66,tx,1,7,[196](cf(i)):cf(i)[178][197](w$)
  100. 1000 [139]cf(i)[179].[167][141]3300:[137]990
  101. 1010 [141]2460:[141]2550:[137]740
  102. 1020 bo[178]5:[141]1970
  103. 1030 [141]1980:[153],"  - str$right$(NULL)(NULL)(NULL)atn(NULL) str$atn(NULL)atn -
  104. 1040 ifmu<1thenx=6:w$="utilities datato display!":gosub2000:goto340
  105. 1050 print,"1. [194]y [205]onth":print,"2. [197]lectricity":print,"3. [212]elephone
  106. 1060 [153],"4. (NULL)ater":[153],"5. (NULL)atural chr$as":[153],"6. 'valdit str$ata' (NULL)enu
  107. 1070 print,"7. [205]ain [205]enu
  108. 1080 [141]2450:[139]n[179]1[176]n[177]7[167][153]"on":[137]1080
  109. 1090 [145]n[137]1100,1170,1260,1350,1440,730,340
  110. 1100 [141]3300:[153]"(NULL)hich month? (1-12) ";:[158]mt[170]66,tx,1,2,[196](mu):i[178][197](w$)
  111. 1105 [139]i[179]1[176]i[177]mu[167][153]:[153]"ononon":[137]1100
  112. 1110 [141]2460:[139](i[178]1)[175](mu[177]1)[167][158]b,m,13," +:(NULL)ext month waitononononononon":[137]1140
  113. 1120 [139](i[178]mu)[175](mu[177]1)[167][158]b,m,13," -:(NULL)rev month waitononononononon":[137]1140
  114. 1130 [139]mu[177]2[167][158]b,m,6," -:(NULL)rev month  +:(NULL)ext month waitononononononon
  115. 1140 gosub2550:if(q$="-")and(i>1)theni=i-1:goto1110
  116. 1150 if(q$="+")and(i<mu)theni=i+1:goto1110
  117. 1160 goto1030
  118. 1170 print"[147]"tab(18)yr$:printtab(29)"[203][215]":printtab(16)"[197]lec"tab(27)"[200]ours
  119. 1180 [153][163]5)"(NULL)onth"[163]16)"lenost"[163]28)"(NULL)sed
  120. 1190 printtab(5)"[183][183][183][183][183]"tab(15)"[183][183][183][183][183][183]"tab(27)"[183][183][183][183][183]":t1=.:t2=.
  121. 1200 fori=1tomu:t1=t1+el(i):t2=t2+kw(i):r=el(i):gosub2120:q$=str$(kw(i))
  122. 1210 printtab(6)m$(i)tab(20-ll)"$"p$tab(32-len(q$))q$:next
  123. 1220 printtab(15)"[183][183][183][183][183][183]"tab(27)"[183][183][183][183][183]":q$=str$(int(t2+.5)):r=t1:gosub2120
  124. 1230 printtab(5)"[212]otal:"tab(20-ll)"$"p$tab(32-len(q$))q$
  125. 1240 r=t1/mu:gosub2120:q$=str$(int(t2/mu+.5))
  126. 1250 printtab(6)"[193]vg.:"tab(20-ll)"$"p$tab(32-len(q$))q$:bz=.:gosub2220:goto1030
  127. 1260 print"[147]"tab(18)yr$"":printtab(16)"[204]ocal"tab(27)"[204]ong
  128. 1270 [153][163]5)"(NULL)onth"[163]16)"(NULL)hone"[163]27)"str$ist"
  129. 1280 [153][163]5)"usrusrusrusrusr"[163]15)"usrusrusrusrusrusr"[163]26)"usrusrusrusrusrusr":t1[178].:t2[178].
  130. 1290 [129]i[178]1[164]mu:t1[178]t1[170]bp(i):t2[178]t2[170]ld(i):r[178]ld(i):[141]2120:q$[178]p$:r[178]bp(i):[141]2120
  131. 1300 [153][163]6)m$(i)[163]20[171]ll)"$"p$[163]31[171][195](q$))"$"q$:[130]
  132. 1310 [153][163]15)"usrusrusrusrusrusr"[163]26)"usrusrusrusrusrusr":r[178]t2:[141]2120:q$[178]p$