POV-Ray : Newsgroups : povray.advanced-users : problem using ORs and strcmp() in #switch/#case : Re: problem using ORs and strcmp() in #switch/#case Server Time
2 May 2024 03:46:23 EDT (-0400)
  Re: problem using ORs and strcmp() in #switch/#case  
From: Kenneth
Date: 11 Nov 2017 14:25:00
Message: <web.5a074d5a1346e9e089df8d30@news.povray.org>
jr <cre### [at] gmailcom> wrote:
> hi,
>
> On 11/11/2017 01:23, Bald Eagle wrote:
> > "Kenneth" <kdw### [at] gmailcom> wrote:
> >> (B)
> >> This ALSO works... two 'numerical values' that match
> >> #switch(27)
> >> #case(C)
> > Similar to the above, although an interesting reversal.
> > I've never thought to do it that way, but it may open up interesting
> > possibilities...  :)
>
> thanks for pointing this out, I'd never have occurred to me.
>
> fwiw, I can't think of another language that allows variables as case
> "constants".  v cool.

And I'm beginning to see that this particular example may be the real cause of
my fundamental question about #switch()-- my quasi-misconception of it's
'Boolean behavior' vs.  comparison of 'simple numerical values.' Because, it
just so happens that in POV-Ray, #switch/#case can do this. (I probably stumbled
on this behavior by accident, when I first began working with #switch-- and then
took it to be ONE of the two 'typical' modes of operation!)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.