From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Returns the character whose ASCII value is passed.
|result||String||The character whose ASCII value was passed.|
|value||Integer||The numeric value ("code point") of the character you want, in the range 0-127.|
The Chr function returns the character whose value is specified. It is valid for the standard ASCII character set only. For this reason, Chr may return unexpected results unless you use it only for ASCII values (0-127).
In general, you should use the Chr method of the TextEncoding class. With it, you specify both the encoding and the character code in that encoding. Please see the example in the TextEncoding class and the last line in this example. In effect, the Chr function supports the special case in which the encoding is ASCII and value is less than 128.
The Chr function will return a single byte string when running on single byte systems and return a double byte string when running on double byte systems. If you need to get a single byte string regardless of whether the system software is single or double byte, use the ChrB function.
These examples use the Chr function to return the characters whose ASCII values are specified.