Quote:
|
A single "=" is an assignment operation and won't do what you want it to do.
|
True. (Hey, a little Boolean humor there).
Quote:
Originally Posted by Jon Stratis
You need to use "==" inside of an if statement to get a Boolean.
|
You don't
need "==" to return a Boolean: a single "=" inside an if() statement will indeed return a Boolean. But as you said above, not what the OP was expecting.
If you already have an appropriately-named Boolean variable, you can cleanly code it by simply testing the variable:
if (limitPressed) {...}