Thanks Mike & TJ.
--- In [email protected], "Mike" <sfclimb...@...> wrote:
>
>
> Aaaargh! Sorry, forgot Google Chrome doesn't play nice with Yahoo's Rich
> Text Editor :(
>
> Logic starts executing at the matching case and continues until a break
> statement or the end of the switch body. So, if you want the same logic
> to apply to multiple cases, then just stack the individual case
> statements together as follows:
>
> switch ( x ) {
> case 9:
> ...
> break
>
> case 10:
> case 11:
> ...
> break;
>
> case 12:
> ...
> break
> }
>
>
> Similarly, if you want the same logic to apply to multiple cases, but
> you also want some additional logic for one of those cases, you can
> start processing the one case, then let it "fall through" to the next
> case group by NOT using a break statement.
>
> e.g.
>
> switch ( x ) {
> case 9:
> ...
> break
>
> case 10:
> ...
> // No break! Fall through to next case
>
> case 11:
> ...
> break;
>
> case 12:
> ...
> break
> }
>
> Mike
>
>
>
> --- In [email protected], "Mike" <sfclimbers@> wrote:
> >
> >
> > --- In [email protected], "sidhartha70" sidhartha70@ wrote:
> > >
> > > Can I use logical operators within the Case statement...??
> > >
> > > i.e.
> > >
> > > Switch (x)
> > > {
> > > Case 9:
> > > ...
> > > Case 10 OR 11:
> > > ....
> > > Case 12:
> > > ....
> > > }
> > >
> >
>