Select Case myvar
Case 27
if (othervar=15) then exit
...
that this would be the way to cause an early exit from a particular Case with execution continuing after the End Select. However it does not. I could of course just invert the sense of the If and put the code for the Case inside it but I view all such strictures as clumsy. Am I overlooking a way to exit early from a Case?
I see that Swift uses Break for an early exit of a Select, and has Fallthrough to allow execution to drop into the following case (as is the default for JS and PHP). Pity Xojo doesn’t have those.
I’m glad they dont as that is very “C” like
Break is the traditional C mechanism for ending the code in a specific case
Fallthrough was what you got IF you forgot to put in a break
I’m not talking about fall through languages. I’m glad that Xojo isn’t one. I’m just pointing out that Swift has a FallThrough statement which implements what happens by default in languages like C, PHP, Javascript. I think that would be a useful addition to Xojo, as would adjusting Exit so that it works inside a Select Case to exit the Select Case, not to exit any enclosing loop or method.
I would respectfully disagree about Fallthrough and would prefer they do not add it
Exit might be useful
They’d need a compiler person to implement them