
-----------------------------------
Aange10
Sat Dec 31, 2011 3:54 pm

If Statements
-----------------------------------
I have a question about if statements:

[code]
if ( i = 10 and e = 4 and r = 6 then) {
    do stuff
}
[/code]

If i = 8, will it ever check for e or r?

-----------------------------------
Tony
Sat Dec 31, 2011 4:39 pm

RE:If Statements
-----------------------------------
Most languages will check the second argument only if the first is not enough to determine the outcome of the expression.

http://en.wikipedia.org/wiki/Short-circuit_evaluation

You can check for this yourself, by having the second argument of a boolean expression to perform some observable side-effect.
