home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 63 / 063.d81 / basics (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  73 lines

  1. 100 dimcat$(11),amount$(11):fori=1to11:ca$(i)="[206]ot defined":am$(i)="0.00":next
  2. 110 ca$(11)="[197]nter [215]ages ->":mode=0
  3. 120 wl$="[215]hat's left ->"
  4. 130 poke53281,15:poke53280,15:print"[147][144]";
  5. 140 sp$="                                      "
  6. 150 rem menu
  7. 160 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][192][192][174]";
  8. 170 print"[221]        [195] [200][160][197][160][193][160][208][160][160][160][195][160][193][160][204][160][195]           [146][221]";
  9. 180 fori=1to11:print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
  10. 190 print"[221]                  [221]                   [221]";:next
  11. 200 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]";:poke2023,125
  12. 210 poke56295,peek(646)
  13. 220 rem clear line links
  14. 230 fori=217to242:pokei,peek(i)or128:next
  15. 240 rem main program
  16. 250 item=11:poke631,13:poke198,1
  17. 260 fori=1to11:poke211,1:poke214,1+2*i:sys58732:printca$(i);
  18. 270 printtab(30-len(am$(i)))"        "am$(i):next
  19. 280 geta$:gosub370:ifa$=""then280
  20. 290 ifa$=""andpeek(653)=4thengosub700
  21. 300 ifa$=""andpeek(653)=0thent=-1:gosub380:it=it+1:ifit>11thenit=1
  22. 310 ifa$="[145]"thent=-1:gosub380:it=it-1:ifit<1thenit=11
  23. 320 ifa$=""ora$="[157]"thent=-1:gosub380:mode=not mode
  24. 330 ifit=11andmode=-1then350
  25. 340 ifa$=chr$(13)then560
  26. 350 t=0:gosub380
  27. 360 goto280
  28. 370 ifti<15thenreturn
  29. 380 t=nott:poke199,-t:poke211,1:poke214,1+2*it:sys58732:if-modethen400
  30. 390 printtab(38-len(am$(it)))am$(it):ti$="000000":return
  31. 400 printca$(it):ti$="000000":return
  32. 410 rem input routine
  33. 420 w$="":print">[146][157]";:limit=8:ifmode=-1thenli=18
  34. 430 geta$:ifa$="[145]"ora$=""ora$="[157]"ora$=""ora$=""ora$="[147]"ora$=""then430
  35. 440 lw=len(w$):as=asc(a$):ifas=13oras=141oras=20then490
  36. 445 ifnotmodethenifas<43oras>57then420
  37. 450 ifpeek(653)=2orpeek(653)=4oras=148then430
  38. 460 iflw=limit and(as<>20andas<>13andas<>141)then430
  39. 470 ifas=34or(as>=133andas<=140)or(as>=1andas<=31)then430
  40. 480 w$=w$+a$:printa$">[146][157]";:lw=len(w$):goto430
  41. 490 ifas=20andw$<>""thenw$=left$(w$,lw-1):print"[157]<[146] [157][157]";:goto430
  42. 500 ifas=20andw$=""then430
  43. 510 ifas=13thenprint" ";:lw=len(w$):return
  44. 520 rem calculate total
  45. 530 tt=val(tt$):fori=1to10:tt=tt-val(am$(i)):next
  46. 540 a$=str$(tt):gosub620:am$(11)=a$:return
  47. 550 rem enter data
  48. 560 poke211,1-(-mo=0)*27:poke214,2*it+1:sys58732
  49. 570 print"           [157][157][157][157][157][157][157][157][157][157][157]";:gosub420
  50. 580 ifmodethenifw$<>""thenca$(it)=w$:goto260
  51. 590 ifw$<>""thena$=w$:gosub620:am$(it)=a$:ifit=11thentt$=a$:ca$(11)=wl$:it=1
  52. 600 gosub530:gosub790
  53. 610 goto260
  54. 620 rem round a$ to nearest penny
  55. 630 a$=str$(val(a$)):a$=a$+".00":a$=str$(int(val(a$)*100+.5)/100)
  56. 640 ifa$=" 0"thena$=" 0.00"
  57. 650 ifval(a$)>.99andval(a$)<10.1thenifval(a$)=int(val(a$))then680
  58. 660 ifmid$(a$,len(a$)-2,1)="."thenreturn
  59. 670 ifmid$(a$,len(a$)-1,1)="."thena$=a$+"0":return
  60. 680 a$=a$+".00":return
  61. 690 rem get two ctrl-q's
  62. 700 poke198,0:poke53281,1:wait198,1:poke53281,15
  63. 710 geta$:ifa$<>""orpeek(653)<>4thenreturn
  64. 720 rem return to loadstar
  65. 730 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  66. 740 if er<>63 then print"[147]":end
  67. 750 a$="hello connect":q$=chr$(34):print"[147]":poke646,peek(53281)
  68. 760 print"load"q$a$q$",8"
  69. 770 print"run":poke631,13:poke632,13:poke198,2:end
  70. 780 rem update top of menu
  71. 790 a$=str$(val(tt$)-val(am$(11))):gosub630:rem calculate expenditures
  72. 800 print"[197]xpenditures:$"a$"    "tab(25)"[195][212][210][204]-[209] to quit":return
  73.