|
|
On Sun, 09 Mar 2003 05:15:02 -0500, Andrew Coppin quoth:
> Returning a value through a macro parameter isn't something I've ever
> done before. Supposing I have a macro like this:
>
> #macro Thingy(alpha, beta)
>
> how do I change the value of, say, beta so that it's accessible form
> outside? Do I use #declare or #local? Does it matter? The manual seems
> to imply I should use #declare (I think!) I'm a bit confused...
It's a little complicated, since it depends on how you call the macro
rather than how you write the macro. You need to pass a declared variable
to the macro rather than a number or expression.
#macro Thingy(alpha, beta)
#local alpha = 3;
#end
#declare A = 1;
Thingy(A, 7) /* This will change the value of A to 3 */
Thingy(A+1, 7) /* This will not change the value of A */
--
Mark
Post a reply to this message
|
|