home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / uploads / mouse-ex.lbr / ASCII.MZE / ASCII.MSE
Encoding:
Text File  |  1993-06-07  |  1.5 KB  |  71 lines

  1.  
  2. 125 N: 20 P: ~ Pause constant, lines per screen constant
  3.  
  4. #S,1; ~ pause ...
  5.  
  6. "!Print ASCII table, 1/30/93, Lee Bradley!!" 
  7.  
  8. 32 s: 128 e: 2 M:  ~ start char., end char., number of columns
  9.  
  10. "First ASCII character = SPACE!"
  11. "Last ASCII character = DEL!"
  12. "Number of columns = 2!!"
  13. "Defaults OK (Y/N) ? "  ?' r:
  14.  
  15. r. 'n = r. 'N = + [
  16.  
  17. "!!Enter the decimal value of the first ASCII character to print."
  18. "!(32 = SPACE) ? " ? s:
  19. "!!Now enter the decimal value of last ASCII character to print."
  20. "!(127 = DEL) ? " ? 1 + e:
  21. ("!How many columns do you want (1..6) ? " ? M: M. 6 > M. 1 < + ^)
  22. "!"  ]
  23.  
  24. #S,1;
  25. #D;
  26. 0 l: s. c:
  27.  
  28. ~ Main loop
  29.  
  30. (
  31. e. c. - ^                    ~ While not done 
  32. c. 100 < ['0 !']
  33. c. ! "  " #H,c.;  " " c. !' "  |"               ~ Print dec., hex., char.
  34. c. 1 + c:                     ~ Bump char., and when  
  35. 1 c. s. - M. \ -[#C,l;]                ~ appropriate, print new line
  36. )
  37.  
  38. ~ Macros follow
  39.  
  40. $H   ~ Convert decimal to hexadecimal
  41. 1% w:
  42. w. 16 / 9 / [w. 16 / 10 - 'A + !']
  43. 10 w. 16 / > [w. 16 / '0 + !']
  44. w. 16 \ 9 > [w. 16 \ 10 - 'A + !']
  45. 10 w. 16 \ > [w. 16 \ '0 + !']
  46. @
  47.  
  48. $S  ~ Pause
  49. N. 1% * w: ( w. 1 - w: w. ^ )
  50. @
  51.  
  52. $C ~ Count lines, do heading 
  53. "!"
  54. 1%. 1 + 1%:
  55. P. 1%. = ["! "  "Strike Any Key -- " 0 1%: ?' 0 * 32 + 8 !' !' #D;]
  56. @
  57.  
  58. $D ~ Heading 
  59. "!"
  60. #Z;
  61. M. w: ( "Dec" "  " "Hx" " " "Ch |" w. 1 - w: w. ^) "!!"
  62. @
  63.  
  64. $Z ~ Universal clear screen
  65. 24 w:
  66. (w. ^
  67. 'J 64 - !'
  68. w. 1 - w:
  69. )
  70. @
  71.