Warp wrote:
...
> If the macro contains control flow commands, you have to use a small
> trick to put a "return value". It works for example like this:
>
> #macro Func(A)
> #if(A < 0)
> #local Result = -A;
> #else
> #local Result = A;
> #end
> A
> #end
>
> The value of the last line of this macro is what is ultimately used as
> the "substitution" of the macro call, which is practice is its "return
> value".
Isn't this what you meant to write Warp ?
#macro Func(A)
#if(A < 0)
#local Result = -A;
#else
#local Result = A;
#end
Result
#end
--
Tor Olav
http://subcube.com
Post a reply to this message
|