POV-Ray : Newsgroups : povray.advanced-users : Break out of main while (1) loop using #break directive in a sub-loop state= : Re: Break out of main while (1) loop using #break directive in a sub-loop state= Server Time
25 Apr 2024 15:18:02 EDT (-0400)
  Re: Break out of main while (1) loop using #break directive in a sub-loop state=  
From: Alain Martel
Date: 16 Jan 2023 11:53:43
Message: <63c58117$1@news.povray.org>
Le 2023-01-15 à 20:05, Bald Eagle a écrit :
> So, clearly the flow control in this other language is different than SDL,
> 
> I have a while (1) with an #if, and then other little nested bits like:
> 
> #if (A >= 0)
>       #for (m, 0, 3)
>            #if (tris[A][m]=R){
>                 #local tris[A][m]=L;
>                 #break;
>            #end
>       #end
> #end
> 
> I'm assuming some, or all of those #break statements are meant to exit the
> #while(1), but of course, they don't, and so I'm stuck in the dreaded infinite
> loop.
> 
> Please advise.
> 
As I understand it : At most, that #break would break out of the #for 
loop, not the #while containing the #for.

In the present case, it will ONLY end the #for loop early if the 
condition is met. The outer #while loop is left unaffected.


Post a reply to this message

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