05-04-2023, 10:09 PM
(05-04-2023, 09:23 PM)James D Jarvis Wrote: Or maybe use Select Case?
Code: (Select All)For i = 1 To 15
a$ = Str$(i)
Select EveryCase i
Case Is > 5
a$ = a$ + " " + Str$(i * 2)
Case Is > 10
a$ = a$ + " " + Str$(i * 3)
End Select
Print a$
Next i
This is only an example I've provided. "EVERYCASE" is confusing and isn't supported by many modern BASIC's. Let's see what Dimster has to say about it. Otherwise he wants to be convinced about which block is better, a single long clause involving "ELSEIF", or "ELSE" section which has its own "IF" block. "SELECT CASE... END SELECT" could help even with multiple variables involved but could get ornery, might have to put specific code sections into a subprogram, perhaps with shared variables to make all the code easier to read.