06-26-2011 10:38 AM
Hi,
I'm having a problem using the formula node.
The output variable is always 1, but I notice that if the code was:
if(N != 1)
L = 1;
else
L = 0;
The program work ok.
Thanks,
Sílvia
06-26-2011 11:01 AM
Your screen shot shows if(N!=1||N!=2). That is if N is not equal to 1 OR N is not equal to 2. Well, since N can never be equal to 1 and 2 at the same time, of course the statemenet always evaluates to True.
If N=0 True OR True = True
If N=1 False OR True = True
If N=2 True OR False = True
If N=3 True OR True = True
06-26-2011 11:16 AM
Silvia,
you must inver the logic because... N is always different from 1 OR different from 2
Try with:
if ( N == 1 || N == 2)
L=0;
else
L=1;
Cheers
06-26-2011 11:27 AM
Thanks,
I verify it after...