POV-Ray : Newsgroups : povray.newusers : conditional statements : Re: conditional statements Server Time
6 Oct 2024 02:00:58 EDT (-0400)
  Re: conditional statements  
From: Chris B
Date: 17 Jul 2009 06:58:51
Message: <4a60596b$1@news.povray.org>
"clipka" <nomail@nomail> wrote in message 
news:web.4a604edd6dc58f70a4aed1130@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>> #switch (0)
>>   #case(strcmp(DoorModel, "model_101"))
>>     ...
>>   #break
>>   #case(strcmp(DoorModel, "model_102"))
>>     ...
>>   #break
>>   #else
>>     ...
>> #end
>
> Ah, now *that's* an interesting idea... thanks, even I still live and 
> learn.
> I've always missed an #if ... #elseif construct in POV-Ray, but looks like 
> this
> is it.
>
> BTW, in POV-Ray 3.7 it should also work with the comparison operator, 
> i.e.:
>
>  #case(DoorModel = "model_101")
>

Well that's good news. That simplifies the syntax. I'll have to give that a 
go. It's worth noting that you'd presumably pass '1' or 'true' into the 
#switch statement rather than '0' using this new syntax.

Regards,
Chris B.


Post a reply to this message

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