home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 February / 1985-02.d64 / address (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  68 lines

  1. 5 print"[147]"
  2. 10 l=12:sys65517:a=peek(781):q$=chr$(13):ifa=40thenpoke53281,15:l=200
  3. 20 dimm$(l,6),n$(6):fori=1to6:readn$(i):next
  4. 30 datalast name,first name,address,city/state,zip code,telephone
  5. 40 print"[147][144]address file"q$"1..retrieve file"q$"2..add/start file"
  6. 50 print"3..edit file"q$"4..display file"q$"5..save and end"
  7. 60 input"your choice";b:onbgosub450,70,130,240,450:goto40
  8. 70 n=n+1:print"[147]record #"n:forj=1to6:printq$"[144]";n$(j);"[146]":inputm$(n,j)
  9. 80 nextj:print" n[146]ext d[146]elete e[146]nd"
  10. 90 geta$:ifa$=""or(a$<>"d"anda$<>"n"anda$<>"e")then90
  11. 100 ifa$="n"then70
  12. 110 ifa$="e"then40
  13. 120 n=n-1:goto70
  14. 130 gosub660:fori=1ton:ifb$=m$(i,1)then150
  15. 140 nexti:print"[147]"b$"is not in file.":gosub620:goto40
  16. 150 gosub650:print"change what:":forj=1to6:print""j".."n$(j):next
  17. 160 print"7 ..delete entry":input"your choice";j:ifj<1orj>7then160
  18. 170 ifj=7then210
  19. 180 print"[147]"m$(i,1)", "m$(i,2)
  20. 190 print"[144]old "n$(j)" is":printm$(i,j)q$q$"[144]corrected "n$(j)" is"
  21. 200 inputm$(i,j):gosub620:goto220
  22. 210 fora=iton-1:forj=1to6:m$(a,j)=m$(a+1,j):nextj,a:n=n-1
  23. 220 print"[147]do you wish to:"q$"1..continue editing"q$"2..return to menu"
  24. 230 input"your choice";b:onbgoto130,40:goto230
  25. 240 print"[147][144]which do you want"q$"1..alphabetical"q$"2..individual"
  26. 250 print"3..menu":input"your choice";b:onbgoto260,410,40:goto250
  27. 260 g=n:ifn=0thenprint"no records in file.":fori=1to2000:next:goto40
  28. 270 g=int(g/2)
  29. 280 ifg=0then380
  30. 290 fora=1ton-g
  31. 300 ifm$(a,1)<=m$(a+g,1)then350
  32. 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)
  33. 320 forj=1to6:m$(a,j)=m$(a+g,j):next
  34. 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$
  35. 340 m$(a+g,6)=w$:e=a
  36. 350 nexta
  37. 360 ife=0then270
  38. 370 e=0:goto280
  39. 380 print"[147]":l=0:fori=1ton:l=l+1:printm$(i,1)", "m$(i,2):ifl<>10then400
  40. 390 l=0:gosub620:print"[147]"
  41. 400 nexti:gosub620:goto240
  42. 410 gosub660:fori=1ton:ifb$=m$(i,1)then440
  43. 420 nexti
  44. 430 print"[147]";b$:print"is not in file":gosub620:goto240
  45. 440 gosub650:gosub620:goto240
  46. 450 print"[147]disk or cassette (d/c)"
  47. 460 gete$:if(e$<>"d"ande$<>"c")ore$=""then460
  48. 470 ife$="d"thenf$="@0:addresses":f=1:goto490
  49. 480 f$="addresses":f=0:g$=""
  50. 490 ifb=5then540
  51. 500 iff=1theng$=",s,r"
  52. 510 open1,1+7*f,8*f,f$+g$:gosub580
  53. 520 input#1,n:fori=1ton:forj=1to6
  54. 530 input#1,m$(i,j):next:next:gosub580:close1:gosub580:goto40
  55. 540 iff=1theng$=",s,w"
  56. 550 open1,1+7*f,1+7*f,f$+g$:gosub580
  57. 560 print#1,n:fori=1ton:forj=1to6
  58. 570 print#1,m$(i,j):next:next:gosub580:close1:gosub580:end
  59. 580 iff=0thenreturn
  60. 590 ifo=0thenopen15,8,15:o=1
  61. 600 input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
  62. 610 return
  63. 620 print"[144]any key to cont'"
  64. 630 geta$:ifa$=""then630
  65. 640 return
  66. 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
  67. 660 print"[147]what name do you"q$"want (last name)?":input"";b$:return
  68.