Chr Procedure

Returns a one character length BString whose ASCII or Unicode code is the argument.

Syntax

[ sReturn = ] Chr ( nData )

The Chr procedure syntax has the following parts:

Name

Type

Description

sReturn

BString

Result string

nData

Val Short

ASCII code

Comments

For values in the range of 0x00-0x7F,the function return a BString with the ASCII character.

For values in the range of 0x80-0xFF, the function translate the value using the system default code page.

For Values higher than 0xFF (256) the function assumes the value is a Unicode character and returns a BString with the Unicode character.  Version 11/2021

Example

The following examples shows converting an ASCII character and a Unicode  character to a String or BString:


sRtn : String
bsRtn : BSting

bsRtn=Chr(65)        ! bsRtn="A"L
bRtn=Chr('A')        ! sRtn="A"
bsRtn=Chr(0xA74E)    ! bsRtn="", Unicode character
sRtn=Chr('Ꝏ')                ! sRtn="?", (0x4E)

See Also

Dupl, Str, Val