CHR                                                                        Function

CHR(number)

CHRB(number)

CHRW(number)

Description

CHR returns the equivalent character of an ANSI character code. The required expression, number, is any numeric expression.

The CHRB function is used with byte data contained in a string. Instead of returning a character, which may be one or two bytes, CHRB always returns a single byte. CHRW is provided for 32-bit platforms that use Unicode characters. Its argument is a Unicode (wide) character code, thereby avoiding the conversion from ANSI to Unicode.

Example

REM CHR Example

'CHR returns characters from numbers

DIM Lowercase, Uppercase

Lowercase = CHR(97)

Uppercase = CHR(97 - 32)

PRINT "Lowercase = " & Lowercase

PRINT "Uppercase = " & Uppercase

Output

Lowercase = a

Uppercase = A

Related Items

ASC