home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 February
/
1985-02.d64
/
address
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
68 lines
5 print"[147]"
10 l=12:sys65517:a=peek(781):q$=chr$(13):ifa=40thenpoke53281,15:l=200
20 dimm$(l,6),n$(6):fori=1to6:readn$(i):next
30 datalast name,first name,address,city/state,zip code,telephone
40 print"[147][144]address file"q$"1..retrieve file"q$"2..add/start file"
50 print"3..edit file"q$"4..display file"q$"5..save and end"
60 input"your choice";b:onbgosub450,70,130,240,450:goto40
70 n=n+1:print"[147]record #"n:forj=1to6:printq$"[144]";n$(j);"[146]":inputm$(n,j)
80 nextj:print" n[146]ext d[146]elete e[146]nd"
90 geta$:ifa$=""or(a$<>"d"anda$<>"n"anda$<>"e")then90
100 ifa$="n"then70
110 ifa$="e"then40
120 n=n-1:goto70
130 gosub660:fori=1ton:ifb$=m$(i,1)then150
140 nexti:print"[147]"b$"is not in file.":gosub620:goto40
150 gosub650:print"change what:":forj=1to6:print""j".."n$(j):next
160 print"7 ..delete entry":input"your choice";j:ifj<1orj>7then160
170 ifj=7then210
180 print"[147]"m$(i,1)", "m$(i,2)
190 print"[144]old "n$(j)" is":printm$(i,j)q$q$"[144]corrected "n$(j)" is"
200 inputm$(i,j):gosub620:goto220
210 fora=iton-1:forj=1to6:m$(a,j)=m$(a+1,j):nextj,a:n=n-1
220 print"[147]do you wish to:"q$"1..continue editing"q$"2..return to menu"
230 input"your choice";b:onbgoto130,40:goto230
240 print"[147][144]which do you want"q$"1..alphabetical"q$"2..individual"
250 print"3..menu":input"your choice";b:onbgoto260,410,40:goto250
260 g=n:ifn=0thenprint"no records in file.":fori=1to2000:next:goto40
270 g=int(g/2)
280 ifg=0then380
290 fora=1ton-g
300 ifm$(a,1)<=m$(a+g,1)then350
310 r$=m$(a,1):s$=m$(a,2):t$=m$(a,3):u$=m$(a,4):v$=m$(a,5):w$=m$(a,6)
320 forj=1to6:m$(a,j)=m$(a+g,j):next
330 m$(a+g,1)=r$:m$(a+g,2)=s$:m$(a+g,3)=t$:m$(a+g,4)=u$:m$(a+g,5)=v$
340 m$(a+g,6)=w$:e=a
350 nexta
360 ife=0then270
370 e=0:goto280
380 print"[147]":l=0:fori=1ton:l=l+1:printm$(i,1)", "m$(i,2):ifl<>10then400
390 l=0:gosub620:print"[147]"
400 nexti:gosub620:goto240
410 gosub660:fori=1ton:ifb$=m$(i,1)then440
420 nexti
430 print"[147]";b$:print"is not in file":gosub620:goto240
440 gosub650:gosub620:goto240
450 print"[147]disk or cassette (d/c)"
460 gete$:if(e$<>"d"ande$<>"c")ore$=""then460
470 ife$="d"thenf$="@0:addresses":f=1:goto490
480 f$="addresses":f=0:g$=""
490 ifb=5then540
500 iff=1theng$=",s,r"
510 open1,1+7*f,8*f,f$+g$:gosub580
520 input#1,n:fori=1ton:forj=1to6
530 input#1,m$(i,j):next:next:gosub580:close1:gosub580:goto40
540 iff=1theng$=",s,w"
550 open1,1+7*f,1+7*f,f$+g$:gosub580
560 print#1,n:fori=1ton:forj=1to6
570 print#1,m$(i,j):next:next:gosub580:close1:gosub580:end
580 iff=0thenreturn
590 ifo=0thenopen15,8,15:o=1
600 input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
610 return
620 print"[144]any key to cont'"
630 geta$:ifa$=""then630
640 return
650 print"[147]"m$(i,1)", "m$(i,2)q$m$(i,3)q$m$(i,4)" "m$(i,5)q$m$(i,6):return
660 print"[147]what name do you"q$"want (last name)?":input"";b$:return