11-07-2022, 01:50 AM
One has to pretend there is a forced "FALLTHROUGH" keyword, while "SELECT EVERYCASE" didn't exist. Because that's what it would have required otherwise.
When "SELECT CASE... END SELECT" was invented, it could have been fashioned just like "switch()" in C, thus requiring "EXIT SELECT" or "BREAK" statement at the end of each "CASE" block. The opposite is true. But the need arose where fallthrough was needed, either potentially for all cases above "CASE ELSE", or for just "CASE ELSE".
I'm taking my own topic off course... but the QBJS listing of supported QB64 keywords got my attention about a few things.
Code: (Select All)
INPUT "Input 1, 2, or 3: "; a
SELECT CASE a
CASE IS > 1
PRINT a; "> 1"
'_FALLTHROUGH
CASE IS < 2
PRINT a; "< 2"
'_FALLTHROUGH
CASE IS < 3
PRINT a; "< 3"
CASE ELSE
PRINT "I don't know what a is!"
END SELECT
When "SELECT CASE... END SELECT" was invented, it could have been fashioned just like "switch()" in C, thus requiring "EXIT SELECT" or "BREAK" statement at the end of each "CASE" block. The opposite is true. But the need arose where fallthrough was needed, either potentially for all cases above "CASE ELSE", or for just "CASE ELSE".
I'm taking my own topic off course... but the QBJS listing of supported QB64 keywords got my attention about a few things.