Level 1, lesson 16

# 1.16 Getting ASCII values

Ok, 'EMIT' is a nice addition, but it has its drawbacks. What if you want to emit the character "G". Do you have to look up the ASCII value in a table? No. 4tH has another word that can help you with that. It is called 'CHAR'. This will emit a "G":

         char G emit

The word 'CHAR' looks up the ASCII-value of "G" and leave it on the stack. You can also use '[CHAR]'. It does exactly the same thing. It is included for compatibility with ANS-Forth versions. Note that 'CHAR' only works with printable characters (ASCII 33 to 127 decimal).