POV-Ray : Newsgroups : povray.general : macros returning values : Re: macros returning values Server Time
5 Aug 2024 14:17:07 EDT (-0400)
  Re: macros returning values  
From: Shay
Date: 6 Sep 2002 13:47:37
Message: <3d78ea39@news.povray.org>
Ernst Fritsch <ern### [at] citywebde> wrote in message
news:web.3d78d1281394686cdf77d9a70@news.povray.org...

Not sure this helps you, but my preferred way of doing it is this:

#macro MakeFive (VARIABLE)       // macro to make a variable = 5;
  #local VARIABLE = 5;           // set var referenced by VARIABLE = to 5
#end                             // end #macro MakeFive (VARIABLE)

#local Value = 0;                // name variable
MakeFive (Value);                // assign value to named variable

This uses a few more lines, but allows for a lot more freedom. Of course
this won't work inside of a conditional statement, but there are other
advantages, like being able to assign an entire array to a variable.

 -Shay


Post a reply to this message

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