CHR Function

Returns an ASCII character for an ASCII code.

Category: String
Returned data type: String

Syntax

CHR(<n>)

Required Argument

n

specifies an integer that represents a specific ASCII character; this can be specified as a numeric constant, a field name, or an expression

Details

The CHR function returns nth character in the ASCII collating sequence.
Note: The CHR function can also be used to return any Unicode character when passed a Unicode code point.
See Appendix A: ASCII Values for a complete list of ASCII values.

Examples

Example 1

character_content = chr(97) // outputs the letter "a"
ascii_value = asc("a") // outputs 97

Example 2

The following examples support Unicode code points:
string input_string // this is a string that could contain greek characters
string(1) character
boolean greek_capital
for i=1 to len(input_string)
begin
   character=mid(input_string,i,1)
   if chr(character)>=913 and chr(character)<=939 then
      greek_capital=true
end