Actually I think the code you have in mind is:Thanks for replying. I took a look at the code I had in mind, and it
#1: *if (X) {A} else if (!X) {B}
#2: *the same
Anything that evaluates X more than once is not correct compilation of the code you originally gave.
was not if/elseif. However, it was a very complex piece of code,
involving evaluating a function that returns a bool [in other words if
(function_returns_bool(x,y,z)) {} else {}].
What I did was make the function return the opposite of what it was
returning, (ie. true instead of false) and the program worked
flawlessly, whereas before it was an infinite loop for the reasons I
gave in the OP.
However, I grant that perhaps this fix was due to some peculiarities
of the function, not the if/else statement, so I will retract my
original statement.
RL