02-13-2026, 06:05 PM
I've used compound _IIF statements, and I agree the readability is somewhat poor. That said, I was using a lot of branchless equations and minimizing variables as a coding style and they were far worse to read. It seems to me that if you are looking for short circuiting decisions in complex expressions, then _IIF is somewhat better than my old methods. At least for readability.
Here's a nightmare expression
vl% = (MinOf%(vl% + ch%, 5) * (bs% > 0)) * (md% = 0) + ((-MinOf%(vl% + ch%, 5)_
* (vl% > 5) - MinOf%(vl% + ch%, vl%) * (vl% <= 5)) * (bs% = 0) - MinOf%(vl% + ch%, 5) * (bs% > 0)) * (md% > 0)
It did exactly what it was supposed to do, but try to wrap your brain around it.
The MinOf% function was my homebrewed _MAX command. I suspect that _IIF would be a piece of cake compared to it.
Here's a nightmare expression
vl% = (MinOf%(vl% + ch%, 5) * (bs% > 0)) * (md% = 0) + ((-MinOf%(vl% + ch%, 5)_
* (vl% > 5) - MinOf%(vl% + ch%, vl%) * (vl% <= 5)) * (bs% = 0) - MinOf%(vl% + ch%, 5) * (bs% > 0)) * (md% > 0)
It did exactly what it was supposed to do, but try to wrap your brain around it.
The MinOf% function was my homebrewed _MAX command. I suspect that _IIF would be a piece of cake compared to it.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na:

