POV-Ray : Newsgroups : povray.general : fundamental question re: #switch/#case/#break : Re: fundamental question re: #switch/#case/#break Server Time
29 Jul 2024 18:30:33 EDT (-0400)
  Re: fundamental question re: #switch/#case/#break  
From: Jim Holsenback
Date: 22 Nov 2010 08:17:29
Message: <4cea6d69$1@news.povray.org>
On 11/22/2010 06:40 AM, Kenneth wrote:
> *HOWEVER*, while writing this post, I now see that there might be two
> mutually-exclusive explanations of how #case/#break directives work, in two
> different places in the WIKI:
> 
> http://wiki.povray.org/content/Documentation:Reference_Section_2.5
> says, "If a clause evaluates true but no #break is specified, the parsing will
> fall through to the next #case or #range and that clause conditional is
> evaluated." [This seems clear to me--it's the behavior I expected, as the
> wording is the same in the v3.6.1 included documentation.]

If you're using 3.7betas (for some reason i think/thought you were)
there has been a change in behavior noted here:

http://wiki.povray.org/content/Documentation:Tutorial_Section_1#Changes_and_New_Features_Summary

search for (browser find) break on that page, and the link will
eventually get you to the page you mentioned above. This is our MOST up
to date documentation as with regards to v3.7 ....

> 
> whereas at
> http://wiki.povray.org/content/HowTo:Use_conditional_structures
> it says, "When processing a matching #case or #range clause, if a #break is not
> encountered it continues through successive #case statements whether they match
> or not." [This would, I think, explain the behavior I'm seeing; so this must be
> the accurate explanation.]
> 
> An honestly naive question:  Which mode of operation *should* be correct,
> compared to other standard computational languages?

this page shows last update 10June2008 (very bottom of the page) so I'd
consider this page suspect ... I didn't review the page for accuracy,
but since the last update was a bit ago I think it's a fairly safe
assumption that there is/may be some inconsistencies


Post a reply to this message

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