Locals.TestBool = (Locals.Value != (1||2) ? True: False)
When the value is 1, it returns False. But if the value is 2, it returns True. Does that not work as I expect? Not a traditional OR? Am I missing something? Is that not actually saying If Locals.Value Does NOT Equal 1 OR 2, then True? Why does it return false for only 1?
Solved! Go to Solution.
|| causes a Boolean OR. 1||2 will result in a TRUE. Now that TRUE has to be converted into a numeric to compare to your number, which will be a 1. So 2 does not equal 1, therefore your result is TRUE.
What you really need here is:
Locals.TestBool = (Locals.Value != 1) && (Locals.Value != 2)
With this setup one of the intermediate values will be a FALSE if Value is a 1 or a 2. You need to then AND those values to get the result you want.