|
![](/i/fill.gif) |
Hello,
I stumbled on some possible strange behaviour in the switch statement. I
just want to verify if I am doing something wrong or POV-Ray.
The switch statement is placed inside a loop to calculate a value of a
variable many times.
Here is a short example of the code I wrote. I omitted the necessary
#break statements for readability.
#switch (MySwitchValue)
#case (1) //do something
#case (2) //do something else
#case (3) //etc1
#case (0) //etc2
#else
#end
Now this code works perfectly fine most of the time. Only sometimes it
breaks and it seems that a #case (1) statement is just partly executed.
After that, it continues just as expected.
Now when I do the following the code works again as expected.
#switch (MySwitchValue)
#debug "MyMessage"
#case (1) //do something
#case (2) //do something else
#case (3) //etc1
#case (0) //etc2
#else
#end
Moving the #case (0) right in front of #case (1) also works.
This case gives me the impression that the order seems important. On the
other hand the example with the #debug statement indicates the opposite.
Also, the docs say I may put the clauses in any order I want.
Does anyone know more about this?
Thanks in advance,
Brickman Brick
--
brickcentral.livejournal.com
Post a reply to this message
|
![](/i/fill.gif) |