First of all, let me say that I was really excited to see the true community-power at work in this thread. The initial post was intriguing, and your combined responses have produced the exact cause and appropriate work arounds. Makes me feel proud to be part of this community!

And, as a result of your efforts, my response can be short: the phenomenon is indeed caused by the fact that all parameters of a function are always evaluated. Changing this behaviour would be non-trivial, and might break downward compatibility.

Basically, IIF() is just a bit of 'syntactical candy' which can make certain scripts shorter. If readability and performance are your main concern, good old IF is probably a better choice.

Thanks to all the participants, and keep scripting!

Ruud