home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 September / 1989-09.d64 / memocard (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1989-01-01  |  4.8 KB  |  151 lines

  1. 100 rem copyright 1989 compute! publications, inc.  all rights reserved.
  2. 110 print"[147]"tab(12)"copyright 1989":printtab(6)"compute! publications, inc."
  3. 120 printtab(10)"all rights reserved"
  4. 130 if a=0 then a=1:load"memocard.ml",8,1
  5. 140 poke 53281,0:poke 53280,15:poke646,3:print"[147]"chr$(14)chr$(8):clr
  6. 150 dim sy$,h%,w%,sy%,sx%,f%,le%:printchr$(16):c2=-1
  7. 160 mx=300:dim ms$(mx),ty%(mx)
  8. 170 sy$=" ":fori=1to7:sy$=sy$+sy$:next:sy$=sy$+left$(sy$,127)
  9. 180 sp$=left$(sy$,11):ss$=left$(sy$,39):sh$=chr$(19)+ss$+chr$(19)
  10. 190 dn$="":rt$="":fori=1 to 6:dn$=dn$+dn$:rt$=rt$+rt$:next:dn$=""+dn$
  11. 200 a9=49856
  12. 210 h%=7:w%=36:sx%=2:sy%=4:cn=0:ad=a9+3
  13. 220 print"[147]"tab(15)"[155][205]emo [195]ard[159]":gosub1170
  14. 230 a$=ms$(cn):if cn>hr then hr=cn
  15. 240 printleft$(dn$,sy%-1)
  16. 250 print" [164][164] [195]ard #";str$(cn)" ";
  17. 260 if cn<100 then print" ";:if cn<10 then print" ";
  18. 270 print"[146][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  19. 280 fori=1 to h%:printspc(sx%-1)"[181]":next
  20. 290 printspc(sx%-1)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  21. 300 a$=ms$(cn):sysad,a$:ms$(cn)=left$(sy$,le%)
  22. 310 if f%>132andf%<142thenonf%-132goto360,390,440,1280,500,520,580,1390
  23. 320 if f%<1024 or f%>1044 then ad=a9:goto300
  24. 330 t=f%-1024:on t goto600,760,770,350,980,350,990,1000,350,350,350
  25. 340 on t-10 goto350,350,350,1010,640,1030,1070,710,700,640
  26. 350 ad=a9:goto300
  27. 360 gosub740:if cn=>mx then300
  28. 370 cn=cn+1:ad=a9+3:if cn>hr then hr=cn
  29. 380 goto230
  30. 390 gosub1540:if a=0 then230
  31. 400 printsh$;"[208]rinting..."
  32. 410 open4,4,7:print#4,re$:print#4,lc$;" #";cn;re$:a$=ms$(cn)
  33. 420 for i=0toh%-1:print#4,""mid$(a$,i*w%+1,w%):next
  34. 430 print#4:close4:printsh$:goto220
  35. 440 if ms$(mx)="" then460
  36. 450 t$="[201]nsert and destroy record"+str$(mx):gosub1120:if a=0 then230
  37. 460 t=hr+1:if t>mx then t=mx
  38. 470 for i=t to cn+1 step-1:ms$(i)=ms$(i-1):next:ms$(cn)="":hr=hr+1
  39. 480 if hr>mx then hr=mx
  40. 490 gosub740:goto230
  41. 500 gosub740:if cn>0 then cn=cn-1:goto230
  42. 510 ad=a9:goto300
  43. 520 gosub1540:if a=0 then230
  44. 530 printsh$;"printing..."
  45. 540 open4,4,7:print#4,re$
  46. 550 for j=cntohr:a$=ms$(j):print#4,lc$;" #";j;re$:print#4,"";
  47. 560 for i=0toh%-1:print#4,""mid$(a$,i*w%+1,w%):next:next
  48. 570 print#4:close4:printsh$:goto220
  49. 580 for i=cn+1 to hr:ms$(i-1)=ms$(i):next:ms$(hr)=""
  50. 590 hr=hr-sgn(hr):goto230
  51. 600 if sy%<>4 then630
  52. 610 sy%=13:if c2=-1 then c2=cn:goto230
  53. 620 c2=cn:cn=c3:goto230
  54. 630 c3=cn:sy%=4:cn=c2:goto230
  55. 640 printsh$;"[211]orting...":sys49152,ms$(0)
  56. 650 t=0:for i=0 to mx
  57. 660 if ms$(i)<>"" then t=i:i=366
  58. 670 next
  59. 680 for i=t to mx:ms$(i-t)=ms$(i):ms$(i)="":next
  60. 690 hr=mx-t:printsh$:goto230
  61. 700 printsh$"[197]nter search string";:inputs$
  62. 710 sysa9+9,s$,ms$(cn)
  63. 720 if f%=0 then t$=s$+" [206]ot [198]ound":gosub1090:goto300
  64. 730 cn=cn+f%:goto230
  65. 740 ad=a9+3:t=fre(8):if t<600 and t>0 then printsh$"[215][193][210][206][201][206][199]: [204]ow [207]n [205]emory"
  66. 750 return
  67. 760 cn=0:goto230
  68. 770 ny=0
  69. 780 y=0:z=21:z1=22:gosub900
  70. 790 poke 1067+y*40,32:y=ny:poke1067+y*40,62:poke55339+y*40,7
  71. 800 geta$:if a$=chr$(13) then cn=cn+y:goto220
  72. 810 if a$<>chr$(145) then860
  73. 820 if y>0 then ny=y-1:goto790
  74. 830 if cn=0 then800
  75. 840 ny=z:cn=cn-z1:if cn<0 then ny=ny+cn:cn=0
  76. 850 goto780
  77. 860 if a$<>chr$(17) then800
  78. 870 if y<my then ny=y+1:goto790
  79. 880 if cn>hr-z1 then800
  80. 890 cn=cn+z1:ny=0:goto780
  81. 900 print"[147] [213]se cursor keys, [210][197][212][213][210][206] to select"
  82. 910 for k=0 to z:t=k+cn
  83. 920 if t>hr then k=z:print"--end of file--":goto970
  84. 930 my=k:t$=right$(str$(t),3)
  85. 940 if t<100 then t$=str$(t):if t<10 then t$=" "+str$(t)
  86. 950 print t$;" "left$(ms$(t),35);:if ms$(t)="" then print"-[194][204][193][206][203]-";
  87. 960 print:if k=z then print"--more--"
  88. 970 next:return
  89. 980 cn=hr:goto230
  90. 990 bu$=ms$(cn):t$="[194]uffer stored":gosub1090:goto230
  91. 1000 hf=1-hf:gosub1170:goto230
  92. 1010 t$="[197]rase all data":gosub1120:if a=0 then230
  93. 1020 for k=0 to hr:ms$(k)="":next:hr=0:goto210
  94. 1030 if bu$="" then t$="[194]uffer empty, please get before put":gosub1090:goto230
  95. 1040 if ms$(cn)="" then1060
  96. 1050 t$="[210]eplace current data":gosub1120:if a=0 then230
  97. 1060 ms$(cn)=bu$:goto230
  98. 1070 t$="[197]xit program":gosub1120:if a then print"[147]"chr$(9)chr$(142):end
  99. 1080 goto230
  100. 1090 printsh$;t$:for k=1 to 999
  101. 1100 if peek(198) then k=999:if peek(197)=60 then geta$
  102. 1110 next k:printsh$:return
  103. 1120 printsh$;t$;" (y/n)?"
  104. 1130 getq$:if q$="y" then a=1:goto1160
  105. 1140 if q$="n" then a=0:goto1160
  106. 1150 goto1130
  107. 1160 printsh$:return
  108. 1170 printleft$(dn$,21):printss$:printss$:printss$:printss$;
  109. 1180 printleft$(dn$,21)
  110. 1190 if hf then1240
  111. 1200 print" [159]f1[155] [206]ext    [159]f2[155] [208]revious      [159][208]ress"
  112. 1210 print" f3[155] [208]rint   [159]f4[155] [208]rint to [197]nd  [159][195][212][210][204] [200] for"
  113. 1220 print" f5[155] [201]nsert  [159]f6[155] [196]elete        [159]additional"
  114. 1230 print" f7[155] [204]oad    [159]f8[155] [211]ave          [159]commands";:return
  115. 1240 printtab(10)" [195]ontrol [195]ommands: [146]"
  116. 1250 print" [159][193][155]lternate [195]ard  [159][194][155]egin  [159][199][155]et     [159][200][155] fkeys"
  117. 1260 print" [159][211][155]earch          [159][197][155]nd    [159][208][155]ut     [159][212][155] [211]ort"
  118. 1270 print" [159][210][155]epeat [211]earch   [159][206][155]ew    [159][195][155]hoose  [159][209][155]uit[159]";:return
  119. 1280 f$="":printsh$"[197]nter filename ($ dir)";:inputf$
  120. 1290 if f$="" then printsh$:goto220
  121. 1300 if f$="$" then print"[147]":sysa9+6:goto1280
  122. 1310 q$="":open2,8,2,f$+",p,r":close2:open15,8,15:input#15,a,b$:close15
  123. 1320 if a=0 then open1,8,2,f$+",p,r":goto1350
  124. 1330 if a<>62 then t$=" [196]isk error":gosub1090:goto1280
  125. 1340 t$=" [198]ile not found - [197][210][210][207][210]":gosub1090:goto1280
  126. 1350 input#1,hr:for i=0tohr:input#1,ms$(i):if ms$(i)="_" then ms$(i)=""
  127. 1360 next:close1
  128. 1370 c2=-1:c3=0:sy%=4:cn=0
  129. 1380 t$=str$(hr+1)+" [210]ecords [204]oaded":gosub1090:goto210
  130. 1390 f$="":printsh$"[197]nter name for save";:inputf$
  131. 1400 if f$="" then printsh$:goto230
  132. 1410 if f$="$" then print"[147]":sysa9+6:t$="-done-":gosub1090:goto1390
  133. 1420 q$="":open2,8,2,f$+",p,r":close2:open15,8,15:input#15,a,b$:close15
  134. 1430 if a=62 then open2,8,2,f$+",p,w":goto1500
  135. 1440 if a=0 then goto1460
  136. 1450 t$=" [196]isk [197]rror ":gosub1090:goto1390
  137. 1460 t$="[198]ile exists, overwrite":gosub1120
  138. 1470 if a=0 then220
  139. 1480 open1,8,15:print#1,"s0:";f$:close1:goto1420
  140. 1490 re$=chr$(15):gm$=chr$(8):lc$=chr$(14)
  141. 1500 print#2,hr:for i=0tohr:print#2,ms$(i)
  142. 1510 if ms$(i)=""then print#2,"_"
  143. 1520 next:print#2," ":close2
  144. 1530 t$=str$(hr+1)+" records saved":gosub1090:goto230
  145. 1540 a=1:open7,4,7:close7:t=st
  146. 1550 open7,4:if st=t then close7:return
  147. 1560 printsh$"[208]rinter not ready, press _ to cancel"
  148. 1570 geta$:if a$="_" then a=0:close7:printsh$:return
  149. 1580 if a$="" then t=t+1:if t<9 then1570
  150. 1590 t=0:printsh$:close7:goto1540
  151.