</head> <body> <h1>Chr()</h1> <p>Returns the string (usually a single character) corresponding to the character code indicated by the specified number.</p> <pre class="Syntax">String := <span class="func">Chr</span>(Number)</pre> <h2 id="Parameters">Parameters</h2> <dl> <dt>Number</dt> <dd><p>If Unicode is supported, <em>Number</em> is a Unicode character code between 0 and 0x10FFFF (or 0xFFFF prior to <span class="ver">[v1.1.21]</span>); otherwise it is an ANSI character code between 0 and 255.</p></dd> </dl> <h2 id="Return_Value">Return Value</h2> <p>This function returns a string corresponding to <em>Number</em>. If <em>Number</em> is not in the valid range of character codes, an empty string is returned.</p> <h2 id="Remarks">Remarks</h2> <p>This function supersedes <a href="Transform.htm#Chr">Transform, OutputVar, Chr</a>.</p> <p>The meaning of character codes greater than 127 depends on the <a href="../Compat.htm#Format">string encoding</a> in use, which in turn depends on whether a <a href="../Variables.htm#IsUnicode">Unicode or ANSI</a> executable is in use.</p> <p>Common character codes include 9 (tab), 10 (linefeed), 13 (carriage return), 32 (space), 48-57 (the digits 0-9), 65-90 (uppercase A-Z), and 97-122 (lowercase a-z).</p> <h2 id="Related">Related</h2> <p><a href="Transform.htm">Transform</a>, <a href="Ord.htm">Ord()</a>, <a href="Asc.htm">Asc()</a></p> <h2 id="Examples">Examples</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> Reports the string corresponding to the character code 116.</p> <pre>MsgBox % Chr(116) <em>; Reports "t".</em></pre> </div> </body> </html>