From Clomosy Docs
No edit summary |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 8: | Line 8: | ||
<b>Example</b><br> | <b>Example</b><br> | ||
<pre> | <pre> | ||
var | var | ||
| Line 21: | Line 20: | ||
ShowMessage('Hello'+crlf+'World'); | ShowMessage('Hello'+crlf+'World'); | ||
} | } | ||
</pre> | </pre> | ||
| Line 43: | Line 28: | ||
World | World | ||
</div> | </div> | ||
<h2> See Also </h2> | |||
* [[System_Library#String_Functions | String Functions]] | |||
{{#seo:|title=Chr Using in Clomosy - Clomosy Docs}} | |||
{{#seo:|description=Explore the Chr function in Clomosy to convert ASCII values into characters, with examples demonstrating its use in string manipulation and formatting.}} | |||
Latest revision as of 15:16, 24 December 2024
function Chr(X: Byte) : Char;
Returns the character for a specified ASCII value.
Chr returns the character with the ordinal value (ASCII value) of the byte-type expression, X. The Byte parameter is an unsigned integer value large enough to represent a character. Word or UInt16 is also appropriate, because now that the string type is Unicode, a character is represented by two bytes.
Example
var
tab : char;
crlf : string;
{
// Show the use of Chr
tab = Chr(124);
crlf = Chr(13)+Chr(10);
ShowMessage('Hello '+tab+' World');
ShowMessage('Hello'+crlf+'World');
}
Output:
Hello | World
Hello
World