Hi!
Just figured out that iif can't be used to avoid division by zero errors.
a = iif ( b=0, 0, 5/b) ; fails when b is zero
It's a shame that all of the results are evaluating apart from the result of the condition.
I think it is a Lua "feature", but tested similar method on php and behaves just like Hollywood.
I don't think Andreas would change this, so I just wanted to remind you.
Bye!
iif evaluates both conditions?
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: iif evaluates both conditions?
This is already mentioned in the IIf() documentation with exactly the same example
Re: iif evaluates both conditions?
Hehe, that's correct.
"The person who doesn't read, has no advantage over those who can't read!"
To be honest since I use the great Cubic-IDE add-on I visiting less the also great guide. However it is a mistake that this topic clearly proves.
"The person who doesn't read, has no advantage over those who can't read!"
To be honest since I use the great Cubic-IDE add-on I visiting less the also great guide. However it is a mistake that this topic clearly proves.