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

  1. 10 print"[147]file scanner":poke53280,0:poke53281,0
  2. 100 data 162,0,169,0,157,0,48,157,0,49,232,208,247
  3. 110 data 162,1,32,198,255,32,228,255
  4. 120 data 170,254,0,48,208,3,254,0,49
  5. 130 data 165,144,240,240,32,204,255,96
  6. 200 for j=9472 to 9509
  7. 210 read x
  8. 220 t=t+x
  9. 230 poke j,x
  10. 240 next j
  11. 250 if t<>4954 then stop
  12. 300 input "file name";f$
  13. 310 open 15,8,15
  14. 320 open 1,8,2,f$
  15. 330 input#15,a,b$,c,d
  16. 340 if a<>0 then print b$:end
  17. 350 sys 9472
  18. 360 close 1
  19. 370 close 15
  20. 400 c=0:p=0:n=0:for j=0 to 95
  21. 410 if j>64 and j<91 goto 520
  22. 420 v=peek(12288+j)+256*peek(12544+j)
  23. 430 if j=0 then print "nulls:";v:goto 520
  24. 440 if j=13 then print "returns:";v:goto 520
  25. 450 if j=32 then print "spaces:";v:goto 520
  26. 460 if j=34 then print "quotes:";v:goto 520
  27. 470 if j=44 then print "commas:";v:goto 520
  28. 480 if j=58 then print "colons:";v:goto 520
  29. 490 if j<32 then c=c+v:goto 520
  30. 500 if j>47 and j<58 then n=n+v:goto 520
  31. 510 p=p+v
  32. 520 next j
  33. 530 print "control:";c
  34. 540 print "numerics:";n
  35. 550 print "punctuation:";p
  36. 560 l=0:u=0:for j=65 to 90
  37. 570 v=peek(12288+j)+256*peek(12544+j)
  38. 580 l=l+v
  39. 590 v=peek(12288+128+j)+256*peek(12544+128+j)
  40. 600 u=u+v
  41. 610 next j
  42. 620 print "upper case alpha:";u
  43. 630 print "lower case alpha:";l
  44. 640 t=0:for j=96 to 255
  45. 650 if j>128+64 and j<128+91 goto 680
  46. 660 v=peek(12288+j)+256*peek(12544+j)
  47. 670 t=t+v
  48. 680 next j
  49. 690 print "unusual characters:";t
  50.