05-14-2025, 04:33 PM
(05-14-2025, 12:56 PM)CharlieJV Wrote: Nested _IIF functions can get hard to read.
I would rewrite
Exactly my point - in QB64PE, as with Excel, you can simply format it better to make it readable.
(The same is true for any command, not just IIF. I see a ton of code posted on here with multiple commands on one line done for convenience, where a simple line break + indenting makes it a lot easier to follow.)
(05-14-2025, 12:56 PM)CharlieJV Wrote: That said, I still prefer nested _IFF's than nested IF-THEN-ELSE structure because:
The IF-THEN-ELSE structure really requires me to read the whole thing to figure out what it is doing.
The single assignment statement with nested _IIF's: I know as soon as I read "NoteName$ =" that I'm dealing with an assignment statement that will assign some value to NoteName$.
I've found the same thing - using IIF to neatly wrap up logic makes code easier to understand.
(05-14-2025, 12:56 PM)CharlieJV Wrote: Yeah, I don't have much love for Waldo ...)
Sit down, Waldo!
Poor Waldo!
LoL

