I'm trying to write a macro where I have the line:
Input>part_no,Please Enter the Part Number,1
Is it possible to use an IF command so that if the part_no = an odd number it does one thing and if it's an even number it does something else? I can't work out how to get it to identify odd and even numbers.
If this is not possible, is it possible to use a number of values to compare against like:
IF>%part_no%=1,3,5,7,9,11,13
IF = Odd Number
Moderators: Dorian (MJT support), JRL
Re: IF = Odd Number
Well, I don't find anything that convert int to string here and I don't know how to work with VBS in MS.
Btw, you only need:
value/2
convert to string the result
if result = "*,5" = odd
Sorry for not help you.
Btw, you only need:
value/2
convert to string the result
if result = "*,5" = odd
Sorry for not help you.
Re: IF = Odd Number
Same thing only different.
Code: Select all
//If answer = 1 the number is odd
//If answer =0 the number is even
//Mod only works with whole numbers
Let>number=23
Let>answer={%number%mod(2)}
MDL>answer
Re: IF = Odd Number
Cheers all.
I think I've got it working with this:
Let>x={%part_no% mod 2}
IF>x=0
//Even
Else
//Odd
ENDIF
It seems to be working but if anyone see's a problem with it please let me know as I'm not an expert in this stuff.
I think I've got it working with this:
Let>x={%part_no% mod 2}
IF>x=0
//Even
Else
//Odd
ENDIF
It seems to be working but if anyone see's a problem with it please let me know as I'm not an expert in this stuff.
Re: IF = Odd Number
how about else IF ? does it work too ?