With just that narrow glimpse into what you're doing, I'd say you
should be passing an "indent" down the tree, not a depth.
function display(item, indent = "") {
var result = indent & item.value & chr(10);
for (child : item.children) {
result += display(child, indent & " ");
}
return result;
}
cheers,
barneyb
On 5/25/06, Ian Skinner <[EMAIL PROTECTED]> wrote:
> At the very least, the depth should be passed as an argument
>
> That is what I have done in the past, I was just wondering if there was a
> more "native" way to do this.
>
> It's not that I want to do something in at one level and something else at
> another. But rather, I'm building a recursive display and I want to control
> an indent level by having it increase and decrease as appropriate.
>
> Looking at the amount of code to process the getbasetag output, I think
> keeping track of the level in a variable and passing it in to recursion would
> be simplier after all.
>
> --------------
> Ian Skinner
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/
Got Gmail? I have 100 invites.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241524
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54