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> odd test for odd/even integer pp 141</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ODD                      Test for Odd/Even Integer                   pp 141

 Syntax:  Odd (IntVar) ;

 Type:    Boolean

 Form:    Function

 Purpose: Returns True if Intvar is odd and False if IntVar is even.

 Notes:   Odd is the transfer instruction to convert Integer data
          to Boolean type.


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


 Usage:
       VAR
          IntVar : Integer;               { Must be Integer Type       }

       BEGIN
          If Odd (IntVar) then            { If IntVar is odd numbered  }
             IntVar := IntVar + 1;        { Bump to next even number   }

          If not Odd (IntVar) then        { If IntVar is even numbered }
             IntVar := IntVar + 1;        { Bump to next odd number    }
       END.

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