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> boolean true or false pp 42</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 BOOLEAN                        True or False                          pp 42


 Define:  A Boolean value is either True or False.

 Purpose: Provide a means of testing for a given condition.

 Notes:   True and False are standard identifiers that are defined as
          1 and 0 respectively.  This definition insures that False < True.
          A Boolean variable occupies one byte in memory.


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


 Usage:
       VAR
          OK     :  Boolean     ;   { This usage must be Boolean type }
          IntVar :  Integer     ;   { Define integer type             }

       BEGIN
          IntVar := 14          ;
          OK     := (IntVar = 0);   { OK is true only if IntVar = 0   }
          WriteLn (Ord(OK))     ;   { Returns 0 as IntVar value is 13 }
      END.

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