Function Chr() Foundation
Converts a numeric ASCII code to a character.
Chr( <nAsciiCode> ) --> cCharacter
Chr() converts <nAsciiCode> to the corresponding ASCII character. If a numeric value outside the valid range for ASCII characters is passed, it is implicitly adjusted by a modulus 256 operation (Chr(257)==Chr(1) --> .T.).
Chr() is a conversion function which translates a numeric value into the equivalent ASCII character. The counterpart function Asc() reverses the function Chr(). Chr() can be used in many places:
With Inkey() to convert return values into characters
When sending characters into the keyboard buffer
To produce a warning tone (Chr(7))
When sending characters to the printer
// The example shows various results of the function Chr()
PROCEDURE Main
? Chr(65) // result: A
? Chr( Asc("A") + 32 ) // result: a
? Chr(7) // result: warning tone
? Chr(10) // result: new line
// length of a null string
? Len("") // result: 0
// length of the null character
? Len(Chr(0)) // result: 1
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.