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> char character variable pp 42</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CHAR                        Character Variable                        pp 42


 Define:  256 ordinal values that define the ASCII character set.

 Purpose: Pre-defined array of ASCII characters of type Char.

 Notes:   A characters position in the ASCII character set is its
          ordinality.  The ordinality of 'A' is 65.  'B' is 66.

          Any character in type Char can be expressed by its
          ordinality by using the transfer function, Chr.
          The capital letter 'A' may be expressed as Chr(A).

          Char is stored in memory as a byte value.


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


 Usage:
       VAR
          ChrVar :  Char            ;  { Define ChrVar as type Char       }
       CONST
          A      :  Char = 'A'      ;  { Define constant 'A' as type Char }

       BEGIN
          ChrVar := 'A'             ;  { Assign literal 'A' to ChrVar     }
          ChrVar :=  A              ;  { Assign constant 'A' to ChrVar    }
       END.

See Also: Byte Chr Const Var

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