Arnold, consider this situation:
SELECT CASE Situation
CASE A, B, C
' Do something that i want to do here, but not in D, E and F.
GOTO DoTheRestOfTheTasks
CASE D, E, F
' Do something that i want to do here, but not in A, B or C.
DoTheRestOfTheTasks:
' Do the tasks that apply to All the cases.
END SELECT
If you are worried about the CPU registers getting messed up or not correctly initialized, then remember
that in some cases (not all) MACROS can also do stuff like that.
The above code is more powerful and flexible than what other languages do. Have you seen
Swift's (relatively new programming language) fallthrough? Or... the automatic fallthrough in C++'s SWITCH
statement?
For some, those can sound crazy, but are very powerful and once you get the hang of them, can become
easier to debug. Consider the above example, I could also do it like this:
SELECT CASE Situation
CASE A, B, C
' Do something that i want to do here, but not in D, E and F.
CALL DoGlobalTasks(A, LIST, OF, ALL, THE, PARAMETERS, THAT, I, NEED, TO, USE, TO, COMPLETE, THE, GLOBAL, TASKS) ' Do the rest of the tasks...
CASE D, E, F
' Do something that i want to do here, but not in A, B or C.
CALL DoGlobalTasks(A, LIST, OF, ALL, THE, PARAMETERS, THAT, I, NEED, TO, USE, TO, COMPLETE, THE, GLOBAL, TASKS) ' Do the rest of the tasks...
END SELECT
Better, some would say, but for me, unnecessarily adding complex parameters in a language that was designed to be simpler and quicker to work with is an undesired hassle.
Sometimes i do that out of need, but when there are statements like this...
CALL moduleParts(SD(), 10, ISTRUE(MOD_DATA(SD(oIndex).Index).DataType), 0, MODULE_DATATYPE, VAR_DATA(SD(oIndex).Index).Flags, UDT_DATA(SD(oIndex).Index).Flags, isConDes, Comp(SD(oIndex).Index).Tags, Memory.Globals.Sect(SD(oIndex).managed).Pointer, "")
Trust me... i rater use a small GOSUB than stating the parameters i need in each case, because, this last one, is much harder to mantain or debug than a single GOTO/GOSUB.