POV-Ray : Newsgroups : povray.newusers : conditional statements : Re: conditional statements Server Time
6 Oct 2024 02:42:43 EDT (-0400)
  Re: conditional statements  
From: Alain
Date: 17 Jul 2009 22:25:51
Message: <4a6132af$1@news.povray.org>

> Hi,
> 
> is it possible to write
> 
>  #if (DoorModel == model_101)   in an if statement
> 
> and  in switches
> 
> 
>   #switch(DoorModel)
> 
>            #case (model_101)// do that
> 
> I want to test for strings, is ttah possible in pov.
> 
> thank you
> 
> 
If all your identifiers are of the same format as model_xxx, then, you 
can extract the numerical part and test that as a numeric value.

Or

You can construct your identifiers from a "model_" string concatenated 
to the numerical part.

In both cases, you'd only need to compare numeric variables, whitch is 
much simpler.



Alain


Post a reply to this message

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