KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Determining if an integer is an odd/even number
PRODUCT: 4D | VERSION: 2003.2 | PLATFORM: Mac & Win
Published On: March 11, 2004

Versions: 6.8 & 2003

Here is a simple method that will determine if a numeric value (rounded) is an even number:

` Project Method: IsEvenNumber
C_BOOLEAN($0)
C_LONGINT($1)
If (Mod($1;2)=0)  ` Equivalent to (($1%2)=0)
   $0:=True
Else
  $0:=False
End if