All,
Trying to take variables from the command line and using modulus to check that all variables are either all odd or all even.
example of all even numbers might be
var1 = 10 var2 = 0 var3 = 4
example of all odd numbers might be
var1 = 11 var2 = 1 var3 = 3
So code to check for odd is:
Of course when I have wscript.quit, then I exit and can't check for even numbers. But I need to halt the script
Code for checking even numbers:
Any ideas on how I can check for either condition, both of which are possible? Individually they both work.
Trying to take variables from the command line and using modulus to check that all variables are either all odd or all even.
example of all even numbers might be
var1 = 10 var2 = 0 var3 = 4
example of all odd numbers might be
var1 = 11 var2 = 1 var3 = 3
So code to check for odd is:
Code:
if not (var1 mod 2) then
if not (var2 = 1) then 'second variable is either 0 or 1
if not (var3 mod 2) then
wscript.echo "invalid - must be all odd or even"
wscript.quit
end if
end if
end if
Of course when I have wscript.quit, then I exit and can't check for even numbers. But I need to halt the script
Code for checking even numbers:
Code:
if not (var1 mod 2) then
if not(var2 = 0) then
if not(var3 mod 2) then
wscript.echo "invalid - must be all even or odd"
wscript.quit
end if
end if
end if
Any ideas on how I can check for either condition, both of which are possible? Individually they both work.