From Clomosy Docs

No edit summary
No edit summary
Line 4: Line 4:


'''Example:'''<br>
'''Example:'''<br>
'''var'''
:'''Base Syntax'''
   tab  : char;
   var
  crlf : string;<br>
    tab  : char;
'''begin'''
    crlf : string;
  // Show the use of Chr
 
  tab := '''Chr'''(124);
  begin
  crlf := Chr(13)+Chr(10);
    // Show the use of Chr
  ShowMessage('Hello '+tab+' World');
    tab := Chr(124);
  ShowMessage(<nowiki>''</nowiki>);
    crlf := Chr(13)+Chr(10);
  ShowMessage('Hello'+crlf+'World');
    ShowMessage('Hello '+tab+' World');
  ShowMessage(<nowiki>''</nowiki>);<br>
    ShowMessage('Hello'+crlf+'World');
'''end;'''
  end;
 
:'''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');
  }

Revision as of 13:00, 7 February 2024

function Chr(IntValue Integer):AnsiChar;

The Chr function converts an IntValue integer into either an AnsiChar or WideChar as appropriate.

Example:

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;
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');
 }