[thelist] Switch statement

Amazon Paulo Amazon.Paulo at Amazoniacelular.com.br
Fri Jul 19 08:32:01 CDT 2002


Hi Jay,

>Seems you have answered your own question! :^] Break is needed,
>not only in JavaScript but other languages as well.

Well, not in VBscript :)) And maybe that's why I'm a little bit confused...

>Once 'something is done in one case'
>the next case may or may not be aware of it...so the code
>continues. Break is the same as exit for any conditional where
>each condirional is not 'aware' of the next set of rules. Not
>to mention that it is good coding style. This is different
>behavior from an 'if', and so may seem a little counter-intuitive.

Yeah, I got it, tho it doesn't look much correct to me. I mean, I think it's
somewhat strange using break inside each 'case'...

Paulo Guedes



More information about the thelist mailing list