POV-Ray : Newsgroups : povray.newusers : Incrementing variables in #for loop : Re: Incrementing variables in #for loop Server Time
20 May 2024 17:28:38 EDT (-0400)
  Re: Incrementing variables in #for loop  
From: Bald Eagle
Date: 27 Mar 2020 07:05:00
Message: <web.5e7ddd8b24003e8fb0b41570@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> docs "declare vs local", see paragraph beginning with "Use of #local
> within an include file ...".  (no different, afaict, from being within a macro)

I considered the ephemeral nature and scope, but if it does indeed apply, then I
don't currently see how.  We're definitely looking for the problem/solution in
the same place.

The #declare of Z ought to create a Z that persists in all parts of the scene
Even if it didn't, I'm still in the inc file that I created it in, so in theory
I ought to be able to (and should) use #local (but I'm still in early

#local Z = Z - dz; ought to work because we're still IN the inc file, and IN the
loop - and THAT works in the standalone scene (where I'd think the same #local
issue would apply).   Otherwise I'd have to do some wacky #local Z = global(Z) -
dz; which obviously has it's own failure, and how would you do a #while?

Once the whole loop is complete, I don't need Z or long, because I'm done
defining the object.

Post a reply to this message

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