POV-Ray : Newsgroups : povray.general : Is this a bug, or am I missing something? : Re: Is this a bug, or am I missing something? Server Time
19 Nov 2024 07:28:58 EST (-0500)
  Re: Is this a bug, or am I missing something?  
From: Shay
Date: 3 Apr 2002 12:36:48
Message: <3cab3db0$1@news.povray.org>
I just tried another test and confirmed that changing the value of any
identifier within a macro changes the value of the identifier outside of the
macro as well, even if the identifiers are different.

In the following code, changing NUMBER within the macro also changes
Test_Number outside of the macro. Perhaps this is an intended feature.

#macro Persistence_Of_Identifiers (NUMBER)
 #local NUMBER = NUMBER + 1;
 #write (Test_Out, NUMBER, "\n") // writes 1
#end // #macro Persistence_Of_Dimension (ARRAY)

#fopen Test_Out "Test_Out.inc" write
#local Test_Number = 0;
Persistence_Of_Identifiers (Test_Number)
#write (Test_Out, Test_Number, "\n") // writes 1
#fclose Test_Out

 -Shay





Post a reply to this message

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