ASCII()
The ASCII()
operator
produces an ASCII character.
Syntax
ASCII ( int-expr )
- int-expr is an integer expression. The range of possible values depends on
the current application locale / character set:
- For single byte encodings (like ISO8859-15), the argument must be in the range of 0 to 255.
- For UTF-8, using char length semantics, the argument must be any valid 16bit code point (in the range 0-65535).
- For any other locale setting (any multibyte character set, or UTF-8 using byte length semantics), the argument must be in the range 0 to 127.
Usage
The ASCII()
operator returns the character corresponding to the ASCII code or
16bit UNICODE code point passed as a parameter, in the current character encoding defined by the
application locale.
The ASCII()
function can be also used to produce special characters such as
escape (ASCII(27)
), newline (ASCII(10)
), horizontal tab
(ASCII(9)
).
When the argument is zero,
ASCII()
has a different behavior, depending on the
context: ASCII(0)
only displays theNULL
character within thePRINT
statement.- If you specify
ASCII(0)
in other contexts, it returns a blank space.
Example
MAIN
DISPLAY ASCII(65), ASCII(66), ASCII(7)
END MAIN