home *** CD-ROM | disk | FTP | other *** search
- 0 rem ** records ** written by: denis h. gregg **
- 1 rem **
- 2 if a=0 then a=1:load"0:lptr rtn",8,1
- 3 clr
- 40 dim g$(200):dim rs(200):dimn$(200):c=0
- 50 p1$=" * *"
- 60 p2$="[209] [209]":p3$="**********"
- 70 open15,8,15:open2,8,2,"0:rec_,s,r"
- 80 input#15,e,em$:ife<>0 and e<>62 then gosub 1500:run
- 100 c=c+1:input#2,g$(c),rs(c),n$(c):ifg$(c)<>""then100
- 110 c=c-1:close15:close2
- 120 rem **** menu for options ****
- 130 poke53280,3:poke53281,10:printchr$(142)"[147]"
- 140 print"[146] **************************************":printp1$
- 150 print" * select your option *":printp1$:printp1$
- 160 print" * 1[146]) [158]view all records *":printp1$
- 170 print" * 2[146]) [158]check on one record *":printp1$
- 180 print" * 3[146]) [158]update a record *":printp1$
- 190 print" * 4[146]) [158]add another record *":printp1$
- 200 print" * 5[146]) [158]delete a record *":printp1$
- 210 print" * 6[146]) [158]printout all records *":printp1$
- 220 print" * 7[146]) [158]exit the program *":printp1$
- 230 printp1$:print" * [ enter your selection ] *":printp1$
- 240 print" ****";p3$;p3$;p3$;"**** ";
- 242 poke198,0:wait198,1:getx$
- 245 if val(x$)=0 or x$>"7" then 242
- 250 on val(x$) gosub 270,400,560,750,490,1060,1020:goto130
- 260 rem **** list all records ****
- 270 a=0:gosub310:for a=1toc:d=d+1
- 272 ifd=9 then wait 197,1:poke 198,0:gosub 310
- 280 rs$=str$(rs(a)):l=len(rs$)
- 290 printtab(2)g$(a);tab(27-l)rs$;tab(31)n$(a):nexta:goto1400
- 300 rem **** print 'record page' background ****
- 310 poke53280,13:poke53281,14:printchr$(147):d=0
- 320 print"[146][191][191][191][191][191][191][191][191][191][191][191][191] ** [144]records ** [191][191][191][191][191][191][191][191][191][191][191][191][191]";
- 330 printp2$;"[209] [144]game score * pro * [209]";
- 340 print"[209] [144][197][197][197][197] [197][197][197][197][197] [197][197][197][197][197][197][197] [209]";
- 350 forb=1to18:printp2$;:nextb
- 360 if(a+9)>cthenprint"[209][209] that's all - press return for menu [209][209]";:goto380
- 370 print"[209][209][209][209][209][209]<press return for next page>[209][209][209][209][209][209][145][145][145][145]"
- 380 print"[158]":return
- 390 rem **** format for checking one record. ****
- 400 print"[147] which game did you want to check?"
- 405 printtab(9)"[enter * for listing]":print">";
- 410 gosub 2000:g1$=t$:print"":ifg1$="*"thengosub1230:goto440
- 415 if t$="" then return
- 420 fora=1toc:if g$(a)=g1$ then440
- 430 next a:goto1170
- 440 print"[147] the record for the game of [158]"
- 445 printtab(20-len(g$(a))/2)g$(a)
- 450 print " is[158]";rs(a);"points, held by [158]";n$(a);" !!"
- 460 print tab(8)"[press return for menu]"
- 470 goto 1400
- 480 rem ** delete record ****
- 490 print"[147] which game do you want to delete "
- 495 printtab(9)"[enter * for listing]":print">";
- 500 gosub 2000:g1$=t$:ifg1$="*"thengosub1230:goto520
- 505 if t$="" then return
- 510 fora=1toc:ifg$(a)<>g1$then540
- 520 g$(a)=g$(c):rs(a)=rs(c):n$(a)=n$(c):c=c-1:a=0:ch$="yes"
- 530 printtab(12)"record deleted.":goto820
- 540 nexta:goto1170
- 550 rem *** update record **
- 560 print"[147] enter the game would you like to"
- 570 printtab(9)"change the record in:"
- 575 printtab(9)"[enter * for listing]":print">";
- 580 gosub 2000:g1$=t$:ifg1$="*"thengosub1230:goto610
- 585 if t$="" then return
- 590 fora=1toc:ifg$(a)=g1$then610
- 600 nexta:goto1170
- 610 print "enter your new record score":print">";:gosub 2000:s2=val(t$)
- 612 if t$="" then return
- 615 if s2>rs(a) then 650
- 620 print"[147] you need to do better than";s2
- 625 print" points, when[158]";rs(a);"points"
- 630 print" is the record ![160]!"
- 635 print" practice, practice, practice,"
- 640 print " or better yet, ask ** ";n$(a)" **":print" for help !!"
- 645 print " [hit any key to return to menu]":goto 1400
- 650 g1$=n$(a):print"and who, may i ask, achieved this goal?":print">";
- 655 gosub 2000:n$(a)=t$
- 660 print"[147] *****[146] [158]congratulations !!! *****[146]"
- 670 printtab(20-(len(n$(a))+10)/2)"***[146] [158]";n$(a);" ***[146]"
- 675 if g1$=n$(a)then 690
- 680 printtab(16)"[158]you beat ";g1$"'s record in":goto 695
- 690 printtab(16)"[158]you beat your own record in"
- 695 printtab(20-(len(g$(a)))/2)g$(a):s1=s2-rs(a)
- 700 print" by a whopping";s1;"points ! !":print"[158] i suggest that you ";
- 710 print"call the press and":printtab(8)"have this feat published !!"
- 720 rs(a)=s2:if ch$<>"yes"then ch$="yes-1"
- 730 goto 1400
- 740 rem **** add record ****
- 750 print"[147]"
- 760 print" enter the name of the game as you want"
- 765 printtab(11)"to have it listed:":print">";:gosub 2000:g1$=t$
- 767 if t$="" then return
- 770 for a=1toc:ifg$(a)=g1$ then 950
- 780 nexta:print:print"what is the record in ";g1$:print">";
- 785 gosub 2000:if t$="" then return
- 787 g(c)=val(t$)
- 788 c=c+1:g$(c)=g1$
- 790 print"and, who holds this record":print">";:gosub 2000:n$(c)=t$:ch$="yes"
- 800 printtab(5)"any more records to add [y/n]":poke 198,0:wait 198,1:get j$
- 805 if j$="y"thenprint"[147]":goto760
- 810 rem *** sort then write to disk **
- 820 ifc>8 thenprint"[147] standby... sorting files"
- 830 if ch$="yes"then ch$="yes-1"
- 840 fora=1toc-1:forb=a+1toc:ifg$(a)<g$(b)then870
- 850 te$=g$(a):g$(a)=g$(b):g$(b)=te$:te=rs(a):rs(a)=rs(b):rs(b)=te
- 860 te$=n$(a):n$(a)=n$(b):n$(b)=te$
- 870 nextb:nexta:poke198,0:ifx=6thenreturn
- 880 ifx<6then130
- 890 printtab(6)"writing updated file to disk"
- 900 open15,8,15,"s0:rec_":open2,8,2,"0:rec_,s,w":input#15,e,e$:ife=0then920
- 910 gosub 1500:goto 890
- 920 fora=1toc:print#2,g$(a):print#2,rs(a):print#2,n$(a):nexta
- 930 close15:close2:ifx=7thenend
- 940 ch$="":goto130
- 950 print"[147] you have attempted to enter a game that ":print" already exists";
- 960 print" on this program !":print" if you have that much time to waste,"
- 970 print" then better do some practicing in"
- 980 print" leader board or something !!":print" let's try again - - -"
- 990 print "do you want to: ":print" [1] try to enter another record,"
- 1000 print" [2] return to main menu, or"
- 1010 print" [3] quit this program"
- 1012 poke 198,0:wait 198,1:get x$
- 1015 x=val(x$):if x=0 or x>3 then 1012
- 1017 on x goto 750,1410,1020
- 1020 if ch$="yes"then820
- 1030 if ch$="yes-1"then890
- 1040 sys 8*4096+4
- 1050 rem *** print records ***
- 1060 if ch$="yes"then gosub820
- 1070 print"what is today's date ";:gosub 2000:j$=t$
- 1072 poke 780,4:rem channel number
- 1075 poke 782,0:rem secondary addr
- 1078 sys 828:if peek(783) and 1 then close 4:gosub 1600:goto 1072
- 1080 print#4,chr$(14)chr$(16)"07current commodore records"
- 1090 print#4,chr$(15):print#4,chr$(16)"07"p3$;p3$;p3$;p3$;p3$:print#4,chr$(15)
- 1095 if j$="" then print#4:goto 1110
- 1100 print#4,chr$(16)"45effective as of: ";j$:print#4,
- 1110 print#4,chr$(14)"name of game record * pro *"
- 1120 print#4,"[184][184][184][184][184][184][184][184][184][184][184][184] [184][184][184][184][184][184] [184][184][184][184][184][184][184]"
- 1130 print#4,:fora=1toc:print#4,g$(a);
- 1140 print#4,chr$(16)"37"rs(a);:print#4,chr$(16)"60"n$(a):nexta
- 1150 print#4,chr$(15):print#4,:print#4,:close4,4:goto130
- 1160 rem ** format if record is not listed as entered **
- 1170 print:print" "g1$" is not listed in the records."
- 1180 print " please recheck your data."
- 1190 print""tab(7)"[press return to continue]"
- 1200 goto 1400
- 1220 rem the following will give listing of games for deletions and changes
- 1230 print" use the [158]cursor keys to scroll the"
- 1240 print" games, and the [158]return key to select"
- 1250 print" [172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
- 1252 print" [161] [161]"
- 1254 print" [188][146][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][190]"
- 1260 a=1
- 1270 ifa>cthena=1
- 1280 ifa<1thena=c
- 1290 print""tab(11)g$(a);
- 1295 for j=1 to 18-len(g$(a)):print" ";:next
- 1300 getk$:ifk$=""then1300
- 1310 ifk$=""thena=a+1:goto1270
- 1320 ifk$="[145]"thena=a-1:goto1270
- 1330 ifk$=chr$(13)theng1$=g$(a):goto1350
- 1340 goto1270
- 1350 print"":return
- 1400 get x$:if x$<>chr$(13) then 1400
- 1410 poke 198,0:return
- 1500 close 2:close 15
- 1510 print"[147] disk error! "em$
- 1520 print" press return to try again"
- 1530 get x$:if x$<>chr$(13) then 1530
- 1540 return
- 1600 print"[147] printer error! please check printer"
- 1610 printtab((5)"and interface and press return"
- 1620 get x$:if x$<>chr$(13) then 1620
- 1630 return
- 2000 t$="":print"[164]";
- 2010 get a$:if a$="" then 2010
- 2020 x=asc(a$)
- 2030 if x=13 then print"[157] ":return
- 2040 if x=20 and len(t$)=0 then 2010
- 2050 if x=20 then t$=left$(t$,len(t$)-1):print"[157] [157][157][164]";:goto 2010
- 2055 if len(t$)>18 then 2010
- 2060 if x<32 or x>218 then 2010
- 2070 if x>95 and x<193 then 2010
- 2080 if x=34 then 2010
- 2090 t$=t$+a$
- 2100 print"[157]"a$"[164]";
- 2110 goto 2010
-