Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> chr return character from ordinal pp 142</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CHR                    Return Character from Ordinal                 pp 142

 Syntax:  Chr (NumVar) ;

 Type:    String, Char

 Form:    Function

 Purpose: Returns ASCII character of numeric argument.

 Notes:   CHR is invalid when declaring set constants and results in
          compiler Error 41.  Use the pound sign (#) with the ordinal of
          the desired character.  Especially useful for the line drawing
          characters.


 ----------------------------------------------------------------------------



 Usage:
       CONST
          WhiteSpace : Set of Char = [Chr(7),Chr(10),      { Error 41 }
                                      Chr(13),Chr(32)];
          WhiteSpace : Set of Char = [#8,#10,#12,#13,#32];

       VAR
          StrVar : String [1]    ;
          NumVar : Integer       ;

       BEGIN
          StrVar := Chr (NumVar) ;
          StrVar := Chr ($41)    ;
       END.

See Also: Byte Char Ord

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson