POV-Ray : Newsgroups : povray.newusers : Incrementing variables in #for loop : Re: Incrementing variables in #for loop Server Time
20 Sep 2021 10:42:14 EDT (-0400)
  Re: Incrementing variables in #for loop  
From: Alain Martel
Date: 28 Mar 2020 11:05:09
Message: <5e7f67a5$1@news.povray.org>
Le 2020-03-27 à 13:55, Bald Eagle a écrit :
> 
> 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.
> 
> 

In the stand alone case, it seems that #local act the same as #declare.


Post a reply to this message

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