Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nesting _IFF
#6
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. Wink 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:
Reply


Messages In This Thread
Nesting _IFF - by Dimster - 02-12-2026, 10:19 PM
RE: Nesting _IFF - by a740g - 02-12-2026, 10:29 PM
RE: Nesting _IFF - by SMcNeill - 02-12-2026, 10:54 PM
RE: Nesting _IFF - by Dimster - 02-13-2026, 04:20 PM
RE: Nesting _IFF - by Jack - 02-13-2026, 04:30 PM
RE: Nesting _IFF - by OldMoses - 02-13-2026, 06:05 PM
RE: Nesting _IFF - by Kernelpanic - 02-13-2026, 09:12 PM
RE: Nesting _IFF - by NakedApe - 02-13-2026, 09:44 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)