Chr

Syntax:

    stringvar = CHR(bytevar)

Command Availability:

Available on all microcontrollers.

Explanation:

The CHR function creates a one-character string from an ANSI (1-byte) character code.

ASC is the natural complement of CHR — it converts a character back into its byte code.

Example:

    _string_ = CHR( 65 )   ' Returns "A"          ' <<< the CHR instruction

    _string_ = CHR( 66 )   ' Returns "B"

Key line: CHR( 65 ) — converts the ASCII code 65 into the one-character string "A".

See Also:

  • Asc — the inverse operation, converting a character back to its byte code