[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Switch.... Case.... question...



PureBytes Links

Trading Reference Links

Thanks Mike & TJ.

--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> 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 amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "sidhartha70" sidhartha70@ wrote:
> > >
> > > Can I use logical operators within the Case statement...??
> > >
> > > i.e.
> > >
> > > Switch (x)
> > > {
> > > Case 9:
> > > ...
> > > Case 10 OR 11:
> > > ....
> > > Case 12:
> > > ....
> > > }
> > >
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/