05-13-2025, 05:11 PM
I just recently upgraded to the newest version. I have to say I like _IIF as well.
It nests well too as a function from my recent guitar fret board ap demonstrates:
FUNCTION NoteName$ (n AS tone)
'IF n.ac THEN ' If note enharmonic
' IF Vtog%(shrp_flt) THEN ' If in flat mode
' NoteName$ = n.bf
' ELSE ' If in sharp mode
' NoteName$ = n.bs
' END IF
'ELSE ' If note NOT enharmonic
' NoteName$ = n.nt
'END IF
NoteName$ = _IIF(n.ac, _IIF(Vtog%(shrp_flt), n.bf, n.bs), n.nt)
END FUNCTION 'NoteName$
Nine lines of a compound IF...THEN block distilled down to one is not too shabby.
It nests well too as a function from my recent guitar fret board ap demonstrates:
FUNCTION NoteName$ (n AS tone)
'IF n.ac THEN ' If note enharmonic
' IF Vtog%(shrp_flt) THEN ' If in flat mode
' NoteName$ = n.bf
' ELSE ' If in sharp mode
' NoteName$ = n.bs
' END IF
'ELSE ' If note NOT enharmonic
' NoteName$ = n.nt
'END IF
NoteName$ = _IIF(n.ac, _IIF(Vtog%(shrp_flt), n.bf, n.bs), n.nt)
END FUNCTION 'NoteName$
Nine lines of a compound IF...THEN block distilled down to one is not too shabby.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na:

