Paul Jones wrote:
>
> How do I make a macro call itself with out getting an error message such
> as "too many nested symbols"?
>
You need some parameter to control recursion depth.
The following macro does nothing but call itself recursively R times:
#macro Recurse(R)
#if(R>0)
Recurse(R-1)
#end
#end
Once the counter has hit zero, the parser falls out of all the nested instances.
You may of course add conditions that reset the counter in some instance, and
thus make the macro go into another recursive 'branch'
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Post a reply to this message
|