Contents

" Use short-circuit evaluation"

This check box controls whether your program uses short-circuit evaluation for the boolean operators and and or. When short-circuit evaluation is used for the boolean and operator, your program evaluates the left-hand operand and if the result is false, then the right-hand operand is not evaluated because the result of the operation must be false. When short-circuit evaluation is used for the boolean or operator, your program evaluates the left-hand operand and if the result is true, then the right-hand operand is not evaluated because the result of the operation must be true.

You might want to disable short-circuit evaluation if you need the side-effects of evaluating the right operand. For example, suppose the right operand is a call to a function which modifies some global variables (a side-effect) in addition to returning a boolean value, then short-circuit evaluation might cause the function not to be called and therefore the global variables will not get modified. If you want to make sure that the right operand is always evaluated then disable short-circuit evaluation.

Contents