Re: New switch/case idea
- Posted by Fernando Apr 06, 2009
- 1674 views
DerekParnell said...
irv said...
OK, one more question. Without specifying "with fallthru" - i.e: using the defaults - then only the matching case will be executed, with or without a break being in there, is this correct? break can be left out?
Yes. "break" is optional if you do not have "with fallthru". If you use it, it has no effect because you don't fall through anyway.
If the break is not the last statement of the case and if it works as in C language, then break has an effect: it aborts the switch statement immediately.
- Fernando