POV-Ray : Newsgroups : povray.general : #declare blah =3D -1; // bug avoidance (avoids "incomplete function or s= : Re: #declare blah Server Time
31 Jul 2024 22:13:28 EDT (-0400)
  Re: #declare blah  
From: Tim Attwood
Date: 7 Aug 2006 00:26:49
Message: <44d6c109$1@news.povray.org>
> I guess it's related to the already known macro-bug: if you return results 
> via the parameters, every now and then the parameter will be returned 
> unchanged.
>
> So, if your macro works like this:
> #macro DoSomething(Variable)
>   #declare Variable=Variable+1;
> #end

A good workaround is just to pass values by substitution instead...
#macro DoSomething(Variable)
   #declare result = Variable+1;
   (result)
#end

Then call the macro from a declare.
#declare Variable = DoSomething(Variable);


Post a reply to this message

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