08-17-2024, 03:35 PM
In such cases, I try to go with SELECT CASE, nested between IF statements, just for the difference in visibility of flow for me.
Too many ELSEIFs, and I get lost trying to track and keep up with them all. Instead, I'll swap to independent IFs and GOTOs, to keep my brain organized better.
IF (condition) THEN
stuff
GOTO done_iffing_around
END IF
IF (next condition...
same
IF (same for 4 more ELSEIF type things...
same
END IF
done_iffing_around:
Too many ELSEIFs, and I get lost trying to track and keep up with them all. Instead, I'll swap to independent IFs and GOTOs, to keep my brain organized better.
IF (condition) THEN
stuff
GOTO done_iffing_around
END IF
IF (next condition...
same
IF (same for 4 more ELSEIF type things...
same
END IF
done_iffing_around: