|
|
SO...
With all of this new-found knowledge, I actually came up with some code that
works consistently-- and that still uses my original OR statements(!)
#switch(1)
#case(
(strcmp(IMG_TYPE,AA)=0) // if strcmp(...) returns zero, then 0=0 is 'true',
// which matches #switch. Otherwise, 'false'.
| (strcmp(IMG_TYPE,BB)=0) // ditto
| (strcmp(IMG_TYPE,CC)=0) // ditto
This construct also works in my real scene code, I'm happy to say. (And with the
ORs in any order.) I prefer the ORs because the real scene has numerous #case
clauses, each with four or five strcmp()s. It all simply looks more compact
this way, to my eyes.
It's all starting to make sense to me now (although I still need to digest some
of the comments.) I also see that there are, as usual, various ways to get
similar results.
THANKS for taking the time with the insights, examples, and discussion! (And if
I'm still not 'getting it', don't hesitate to say so!)
Post a reply to this message
|
|