Skip to main content

CHR( ) ASCII Character of Value

Format

CHR(num[,ERR=stmtref])

Where:

num

Value of the character to return. Numeric expression. Range: integer from 0 to 255 (the character's number in the ASCII table).

stmtref

Program line number or statement label to which to transfer control.

Returns

Single ASCII character.

Description

The CHR( ) function returns a single-character ASCII string of the numeric expression defined by num. The value of num must be an integer in a range from 0 to 255 (the position of the character in the ASCII table). The first printable character in the ASCII character set is the blank, $20$, which is CHR(32).

(The ability to access/change the printable character tables was added in PxPlus v7.10.)

See Also

ASC( ) Get Internal Character Value

Example

X$=chr(65) ! (Sets X$ to "A")
X$=chr(33) ! (Sets X$ to "!")