|
|
clipka <ano### [at] anonymousorg> wrote:
> Also, there's a much easier way to achieve a logical OR in any `#switch`
> construct: Just place multiple `#case` statements without a `#break` in
> between, like so:
>
> #switch(0)
> #case(strcmp(STRING,CONST1A))
> #case(strcmp(STRING,CONST1B))
> // go here if STRING = CONST1A or CONST1B
> #break
> #case(strcmp(STRING,CONST2A))
> #case(strcmp(STRING,CONST2B))
> // otherwise go here if STRING = CONST2A or CONST2B
> #break
Yes, I had considered mentioning this possibility (I've discovered it
accidentally by failing to include the #break(s) :O, so I'm glad you provided
this example.
Thanks for all of the other examples - useful stuff and a very good supplement
to the official docs :)
Post a reply to this message
|
|