CHR( ) function

Returns the character associated with the specified ASCII character code.

Syntax

CHR(number)

Parameters

number

Numeric. A valid numeric expression between 1 and 255.

Output

Character.

Remarks

You can use this function to reference any ASCII character, including those that cannot be entered directly from a keyboard or displayed on screen. The CHR( ) function can be used to search fields or records for the existence of these specific characters.

If the value entered for number is greater than 255, the value returned is the remainder of the number value divided by 256. It is equivalent to entering MOD(number, 256).

Referencing the ASCII NUL (null) character, CHR(0), may produce unpredictable results because it is used by ACL as a text qualifier, and should be avoided if possible.

The CHR( ) function is the inverse of the ASCII( ) function.

Example

In the following example, the CHR( ) function is used to add the UK pound symbol £ (ASCII character 163) to each of the values in a currency field.

CHR(163)+"123.45"

returns “£123.45”

Related reference
ASCII( ) function


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback