Syntax
CHR( expression )
Description
CHR
returns
a single byte string containing the character represented by the ASCII code passed to it. For example, CHR(97)
returns "a".
Note:
There is no need for a
complimentary function, as that type conversion is automatic, see sample code
below.
Example
PRINT "the character represented by the ASCII code of 97 is:";
CHR(97) ' will
print a
DIM
a$(10)
' examples of automatic type conversion complimentary to CHR
a$="asdf"
PRINT a$(0),
chr(a$(0))
' will print 97 a
x = a$(0)
PRINT
x
' will print 97
if x = "a" then PRINT
"it is a" ' will
print it is a
Differences from other BASICs
- does not exist in PBASIC
- same function exists in Visual BASIC/
See also