CHR Function

Returns an ASCII character for an ASCII code.

Category: String
Returned data type: String

Syntax

CHR(<n>)

Arguments

n

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.

Examples

Example 1

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

ascii_value = asc("a") // outputs 97

Example 2

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