home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 July / 1992-07.d64 / speedpurge (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  49 lines

  1. 5 rem copyright 1992
  2. 10 rem compute publications intl ltd
  3. 15 rem all rights reserved
  4. 20 clr:dima$(500):open15,8,15
  5. 25 print"[147][154]speedpurge"
  6. 30 poke53280,0:poke53281,0
  7. 35 input"file (a-z) ";f$
  8. 40 iflen(f$)>1then25
  9. 45 ifasc(f$)<65orasc(f$)>90then25
  10. 50 open2,8,2,"0:"+f$+",s,r":gosub225:b$=f$:x=1:poke781,2:sys65478:sys65487
  11. 55 sys65487:a=peek(780)
  12. 60 ifa>127thena=a-64:b$=b$+chr$(a):a$(x)=b$:b$=f$:x=x+1:goto80
  13. 65 ifa=39then75
  14. 70 ifa<64thena=a+64
  15. 75 b$=b$+chr$(a)
  16. 80 ifst=0then55
  17. 85 close2:poke781,0:sys65478:x=x-1
  18. 90 z=1
  19. 95 it=0:print"[154]":fort=ztox:a$=a$(t):print"[145]        [157][157][157][157][157][157][157][157]";t;"-";x:forr=1tox
  20. 100 ifa$=a$(r)thenifr<>tthengosub220
  21. 105 nextr,t
  22. 110 ifit=0then125
  23. 115 ifit=xthenx=x-1:goto95
  24. 120 fort=ittox-1:a$(t)=a$(t+1):nextt:x=x-1:goto95
  25. 125 print"":fort=1tox:printt;a$(t):a$(t)=right$(a$(t),len(a$(t))-1)
  26. 130 b$="":forr=1tolen(a$(t))-1:a=asc(mid$(a$(t),r,1)):ifa>63thena=a-64
  27. 135 b$=b$+chr$(a):nextr:a=asc(right$(a$(t),1)):a=a+64:b$=b$+chr$(a)
  28. 140 a$(t)=b$:nextt
  29. 145 print"[154]save this file y/n"
  30. 150 geta$:ifa$=""then150
  31. 155 ifa$="n"then190
  32. 160 ifa$<>"y"then150
  33. 165 print#15,"s0:"+f$:gosub230
  34. 170 open2,8,2,"0:"+f$+",s,w":poke781,2:sys65481:poke780,13:sys65490
  35. 175 fort=1tox:forr=1tolen(a$(t)):a$=mid$(a$(t),r,1):a=asc(a$):poke780,a
  36. 180 sys65490
  37. 185 nextr,t:close2:poke781,3:sys65481:gosub230
  38. 190 print"[150]finished!"
  39. 195 print"[154]do another file y/n"
  40. 200 geta$:ifa$=""then200
  41. 205 ifa$="y"then20
  42. 210 ifa$="n"thenclose15:end
  43. 215 goto200
  44. 220 print"found a match! ";chr$(34);a$(r);chr$(34);" ";t;"&";r
  45. 225 z=t:it=r:t=x:r=x:return
  46. 230 input#15,en,em$,et,es
  47. 235 print""en;em$;et;es:ifen>1thenclose15:stop
  48. 240 return
  49.