Purpose
Returns a one-character string corresponding to a specified character code. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Chr$( num_expr )
num_expr is an integer value from 0 to 255 (or, if a double-byte character set is in use, from 0 to 65,535), inclusive.
Return Value
String
Description
The Chr$() function returns a string, one character long, based on the character code specified in the num_expr parameter. On most systems, num_expr should be a positive integer value between 0 and 255. On systems that support double-byte character sets (e.g., Windows Japanese), num_expr can have a value from 0 to 65,535.
If the num_expr parameter is fractional, MapBasic rounds to the nearest integer.
Character 12 is the form-feed character. Thus, you can use the statement Print Chr$(12) to clear the Message window. Character 10 is the line-feed character; see example below.
Character 34 is the double-quotation mark ("). If a string expression includes the function call Chr$(34), MapBasic embeds a double-quote character in the string.
In Unicode versions of MapInfo Pro, this function operates in the system character set in a compatible manner with the non-Unicode versions of MapInfo Pro.
Error Conditions
ERR_FCN_ARG_RANGE (644) error is generated if an argument is outside of the valid range.
Example
Dim s_letter As String * 1
s_letter = Chr$(65)
Note s_letter ' This displays the letter "A"
Note "This message spans" + Chr$(10) + "two lines."
See Also:
Asc() function, ChrU$() function, Character Code Table Definitions