POV-Ray : Newsgroups : povray.advanced-users : simple for...loop question : Re: simple for...loop question Server Time
30 Jul 2024 00:24:41 EDT (-0400)
  Re: simple for...loop question  
From: Rune
Date: 29 Jun 2000 13:09:55
Message: <395b82e3@news.povray.org>
"Eitan Tal" wrote:
> ....in case I didn't use the right name, for (at least on basic)
> is some statement that makes a loop with a value that changes
> untill it gets equal to another value, and then the loop ends

This should be what you want.
This loop is "safe" becaue it won't go on forever, even if the value cannot
be found.

#declare C = 0;
#declare Max_Loops = 1000000000;
#declare Flag = false;
#while ( Flag=false & C<Max_Loops )

   // Insert your stuff here

   #if (One_Value=Another_Value)
      #declare Flag = true;
   #end
   #declare C = C+1;
#end

Greetings,

Rune
--
Updated June 12: http://rsj.mobilixnet.dk
3D images, include files, stereograms, tutorials,
The POV Desktop Theme, The POV-Ray Logo Contest,
music, 350+ raytracing jokes, and much more!


Post a reply to this message

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