|
|
"Kenneth" <kdw### [at] gmailcom> wrote:
> But here's a very similar example (though without any ORs, which might make all
> the difference), and it selects the 2nd #case (green)...
>
> #switch(true)
> #case(0)
> rgb <0, 0, 0.2> // BLUE
> #break
> #case(1)
> rgb <0,1,0> // GREEN
> #break
> ....
>
> This makes sense to me (well, at the moment, anyway!), as it looks like
> #switch(true) is picking the #case with the appropriate 'true' result of (1)
Right. "true" "on" "yes" all evaluate to 1 in SDL.
> *That's* a really unexpected result, IMO; neither of the #switch's strcmp()s
> 'match' IMG_TYPE (which would be AA), yet #case(1) is chosen as if #switch is
> 'true.'
Yes, (now that I've gotten some sleep, and looked at the #debug output) I see
that's the case. I probably won't have an opportunity to run any more tests
until tonight.
Post a reply to this message
|
|