P
polilop
how can i check if a variable is an even number?
polilop said:how can i check if a variable is an even number?
Mark J. McGinty said:Assuming the variable identifier is 'n':
If (n Mod 2) = 0 Then ...
Mod is the VBS modulus operator, it returns the remainder of a division
operation.
-Mark
Mark said:If (n Mod 2) = 0 Then ...
Dave Anderson said:Alternatively:
If n/2 = n\2 Then ...
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.