POV-Ray : Newsgroups : povray.pov4.discussion.general : I want to be rid of my stupid mistakes : Re: I want to be rid of my stupid mistakes Server Time
19 May 2024 05:14:05 EDT (-0400)
  Re: I want to be rid of my stupid mistakes  
From: Warp
Date: 22 Jul 2009 11:34:36
Message: <4a67318c@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> #declare i=0;
> #while (i<5)
>   ...
>   #if (something happens that makes me want to terminate the loop early)
>     #declare i=-1;
>     #end
>   #else
>     #declare i=i+1;
>   #end
> #end

  I think that what you wanted to express there is a #break, not an #end.
(No, #break does not currently interrupt loops, although I don't see any
reason why it couldn't.)

  You can currently achieve the same effect with:

#declare i=0;
#while (i<5)
  ...
  #if (something happens that makes me want to terminate the loop early)
    #declare i=5;
  #else
    #declare i=i+1;
  #end
#end

-- 
                                                          - Warp


Post a reply to this message

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