From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
'''Example:'''<br> | '''Example:'''<br> | ||
:''' | |||
:'''TRObject Syntax''' | |||
var | var | ||
tab : char; | tab : char; | ||
crlf : string; | crlf : string; | ||
{ | |||
// Show the use of Chr | // Show the use of Chr | ||
tab | tab = Chr(124); | ||
crlf | crlf = Chr(13)+Chr(10); | ||
ShowMessage('Hello '+tab+' World'); | ShowMessage('Hello '+tab+' World'); | ||
ShowMessage('Hello'+crlf+'World'); | ShowMessage('Hello'+crlf+'World'); | ||
} | |||
:''' | :'''Base Syntax''' | ||
var | var | ||
tab : char; | tab : char; | ||
crlf : string; | crlf : string; | ||
begin | |||
// Show the use of Chr | // Show the use of Chr | ||
tab = Chr(124); | tab := Chr(124); | ||
crlf = Chr(13)+Chr(10); | crlf := Chr(13)+Chr(10); | ||
ShowMessage('Hello '+tab+' World'); | ShowMessage('Hello '+tab+' World'); | ||
ShowMessage('Hello'+crlf+'World'); | ShowMessage('Hello'+crlf+'World'); | ||
end; | |||
Revision as of 10:49, 23 August 2024
function Chr(IntValue Integer):AnsiChar;
The Chr function converts an IntValue integer into either an AnsiChar or WideChar as appropriate.
Example:
- TRObject Syntax
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');
}
- Base Syntax
var
tab : char;
crlf : string;
begin
// Show the use of Chr
tab := Chr(124);
crlf := Chr(13)+Chr(10);
ShowMessage('Hello '+tab+' World');
ShowMessage('Hello'+crlf+'World');
end;