Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to optimize use of the treeview-control in VFP?
Message
From
29/01/1999 18:49:12
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
29/01/1999 06:03:16
Frank Gynnild
Radar Software As
Trondheim, Norway
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00181709
Message ID:
00182075
Views:
18
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform