Re: New switch/case idea
- Posted by euphoric (admin) Apr 01, 2009
- 1911 views
Basically, after the first case is met, ALL following case bodies are run, disregarding the case statement, unless a break is encountered after which it leaves the switch construct.
Case is "if" eye candy...
I used to think that too, but it has a very significant speed advantage. So it's more than just candy. It's candy that's been sprinkled with speed dust!
If all the remaining case bodies run regardless of the case line, then this construct is next to me... errr, useless.
You'll have to see the examples to understand why it's not useless. In fact, it's been said that not only will the Euphoria switch emulate other known switches, ours will be even more powerful!
Anyway... Don't worry. You are still far more useless than a switch construct.