POV-Ray : Newsgroups : povray.general : The Language of POV-Ray : Re: The Language of POV-Ray Server Time
11 Aug 2024 09:18:03 EDT (-0400)
  Re: The Language of POV-Ray  
From: Glen Berry
Date: 14 Mar 2000 00:47:19
Message: <k5DNOCQgqZztI0s4QkLeKxjSP4oA@4ax.com>
On Fri, 10 Mar 2000 12:21:22 +0100, Axel Baune
<aba### [at] neuroinformatikuni-ulmde> wrote:

>Hello,
>
>PoD wrote:

>> Then use a while loop and nothing is lost, except that you've made your
>> script hard to read.  There's probably an easier way to do it using
>> for()
>
>No, you couldn't do everything with a for-loop what you could do with a
>while-loop. The while-loop is far more flexible, beacuse the for-loop is
>a special case of the while-loop for cases where _one_ variable is
>looped through a range of values with a constant step width. 

Did the man say he wanted to *replace* the while-loop, or does he
perhaps want to supplement the while-loop with a for-loop? I see
nothing wrong with having a for-loop in POV. For many situations, it
would be easier for newcomers to understand and it would work
perfectly. The for-loops I have used in the past have also allowed a
STEP parameter that defined the amount of increment for each loop. One
wouldn't have to be limited to incrementing or decrementing by one.


Later,
Glen Berry


Post a reply to this message

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