|
![](/i/fill.gif) |
ingo wrote:
>
> Three little macro's. The first and third are ok, the second is not. The only
> difference between Twee and Drie is the position of the semi-colons. I
> understand that a macro works by text replacement. That does not make me
> understand why Twee doesn't work and Drie does. Can somebody explain?
>
> #macro Een(A,B,C)
> A+B+C
> #end //macro
> #declare Som1=Een(1,2,3);
> sphere {Som1,1}
>
> #macro Twee(A,B,C)
> #local P=A+B+C;
> #if (P=0)
> A+B-C
> #else
> A+B+C
> #end
> #end
> #declare Som2=Twee(1,2,3);
> sphere {Som2,1}
>
> #macro Drie(A,B,C)
> #local P=A+B+C;
> #if (P=0)
> A+B-C;
> #else
> A+B+C;
> #end
> #end
> #declare Som3=Drie(1,2,3)
> sphere {Som3,1}
>
> ingo
> --
> Met dank aan de muze met het glazen oog.
I can't say exactly why this is the case, Twee is the way it should
work.
Note that Drie won't work if you say sphere{Drie(1,2,3),1}
If you say #declare Som2=Twee(1,2,3) without the semi colon, it works
but gives a warning.
Cheers, PoD.
Post a reply to this message
|
![](/i/fill.gif) |