home *** CD-ROM | disk | FTP | other *** search
-
- 125 N: 18 P: #S,1;
-
- "!Print ASCII table, 02/03/88, Lee Bradley!!"
-
- 32 s: 128 e: 2 M:
-
- "First ASCII character = SPACE!"
- "Last ASCII character = DEL!"
- "Number of columns = 2!!"
- "Defaults OK (Y/N) ? " ?' r:
-
- r. 'n = r. 'N = + [
-
- "!!Enter the decimal value of the first ASCII character to print."
- "!(32 = SPACE) ? " ? s:
- "!!Now enter the decimal value of last ASCII character to print."
- "!(127 = DEL) ? " ? 1 + e:
- "!!Enter 4 or 5 for the next question only if you've hit"
- "!CTRL-P and want hardcopy on an Epson."
- "!How many columns do you want (1..5) ? " ? M:
- "!" ]
-
- #S,1;
- M. 3 - ['O '@ - 'L '@ - !' !']
- #D;
- 0 l: s. c:
-
- ~ Main loop
-
- (
- e. c. - ^ ~ While not done
- c. ! 9 !' #H,c.; 9 !' c. !' " |" 9 !' ~ Print dec., hex., char.
- c. 1 + c: ~ Bump char., and when
- 1 c. s. - M. \ -[#C,l;] ~ appropriate, print new line
- )
-
- ~ Macros follow
-
- $H ~ Convert decimal to hexadecimal
- 1% w:
- w. 16 / 9 > [w. 16 / 10 - 'A + !']
- 10 w. 16 / > [w. 16 / '0 + !']
- w. 16 \ 9 > [w. 16 \ 10 - 'A + !']
- 10 w. 16 \ > [w. 16 \ '0 + !']
- @
-
- $S ~ Pause
- N. 1% * w: ( w. 1 - w: w. ^ )
- @
-
- $C ~ Count lines, do heading
- "!"
- 1%. 1 + 1%:
- P. 1%. = ["! " "->" " " 0 1%: ?' 0 * 32 + 8 !' !' #D;]
- @
-
- $D ~ Heading
- #Z;
- M. w: (w. 1 - w: w. ^ " ")" ASCII Table !"
- M. 23 * w: ( "-" w. 1 - w: w. ^) "!"
- M. w: ( "Dec" 9 !' "Hex" 9 !' "Chr |" 9 !' w. 1 - w: w. ^) "!"
- M. 23 * w: ( "-" w. 1 - w: w. ^) "!"
- @
-
- $Z ~ Universal clear screen
- 24 w:
- (w. ^
- 'J 64 - !'
- w. 1 - w:
- )
- @