Forum OpenACS Q&A: Re: How to upvar an array in a recursive procedure

Posted by Tom Jackson on

I think the line:

 get_node $child_id $element $p($level)

probably needs to be changed to:

 get_node $child_id $element p($level)

since p is now the name of the array, I think that is what Jeff was refering to?

Anyway, the practice (which you followed) of passing in the name of the upvar'd array is good practice: always let you api users choose the names of their vars, and pass them to you.

If David is right, and you need to be passing the whole array, you just pass p, not $p.