>I'm currently doing a project involving using two treeview
>controls to make a structure.
>The structure can consist of several thousands nodes.
>- What's the best way to recursively add the nodes in the tree?
> All the data for the nodes in the right three are gathered on
> startup and loaded into a VFP cursor. I've found that
> SCAN
> ...
> ENDSCAN
> doesn't work very well with recursive functions.
It works, but you have to save the Recno() before recursing, and GO back to it after that, so your Scan-EndScan loop continues from the same record. I do it often, and it works nice ever since 2.0.
> The max number of levels in the tree will be about 5-6.
> Is it better to make the addnodes-function non-recursive for
> speed-improvements?
I've built a treeview from a table (using exactly the recursion with scan-endscan), but haven't benchmarked it, and never had more than 50 nodes, so I can't know the speed issues.