POV-Ray : Newsgroups : povray.general : #local access : Re: #local access Server Time
8 Aug 2024 04:11:35 EDT (-0400)
  Re: #local access  
From: Chris Huff
Date: 1 Mar 2001 16:49:29
Message: <chrishuff-D0F5D2.16474901032001@news.povray.org>
In article <3a9eba0c@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> The code works fine. That is, the mother variable "Var" is only 
> accessible if it is not currently being assigned at a lower level. 
> But I thought a variable was not supposed to interfere with anything 
> before the assignment was completed (semi-colon reached) ?  Or is it?

I think this is a bug (if I understand what you mean)...variables inside 
a macro should not affect #local variables outside it, even in a macro 
that calls it.


> On an unrelated note: Isn't there any way I can make the child macro 
> handle and update a variable created in the mother macro, besides 
> making the variable global? I'm afraid not?

Other than having it be the return value? Pass it as a parameter...

#macro Child(ChildVar)
   #local ChildVar = ChildVar + 1; // line 7
   (ChildVar)
#end
#macro Mother(Input)
   #local Var = Input;
   Child(Var)
#end

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

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