POV-Ray : Newsgroups : povray.newusers : Incrementing variables in #for loop : Re: Incrementing variables in #for loop Server Time
20 Sep 2021 10:23:21 EDT (-0400)
  Re: Incrementing variables in #for loop  
From: Bald Eagle
Date: 27 Mar 2020 14:00:01
Message: <web.5e7e3e1024003e8fb0b41570@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:

> The #local Z = Z - dz; is local to the for loop and distinct from the
> variable created with the #declare Z = 1 - dz/2;
> As soon as the local Z is declared, the global Z becomes invisible or
> hidden. That local Z disappears as soon as you exit the for loop.
>
> So, in your include, use only #local and only use #declare if you want
> to affect the global instance of your variables, like when you want to
> pass back some computed values.


This is all well and good, and sound advice in general; however, it does not
explain why it works in the standalone scene and fails to work when the same
exact code is run in an include file.


Post a reply to this message

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