Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recursive loop and SCAN
Message
From
30/07/2002 02:40:18
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
27/07/2002 01:33:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00683191
Message ID:
00683826
Views:
41
>>Yes, it would open one alias per level; depending how deep your structure goes it may or may not be too much. One thing I know is that this becomes too slow (I've seen it done with a SQL select into a new cursor each level, then check if any records were selected), so my favorite technique was to build a key which would order the table into its proper tree order. It only took one rebuild for each save, and worked fine for the intended use (reports dictionary, with very few changes over time). Next time the table was simply open ordered by this key and scanned in a single linear pass.
>
>In our case, it's for a treeview. The table is already properly ordered however I feel it's much more cleaner and simplier by using the recursive approach.

In my case, it was a treeview, and the recursive approach was used while building the key. Then when the treeview needed to be built, the table was ordered using this key, and the treeview was built within a single linear pass through the records. The main (and practically only) reason for this was speed: the table changed very rarely, but the treeview had to be built many times. So this was just a way to have the results of the recursion saved and ready. The difference in speed turned out to be quite significant, somewhere to 6:1 for 200 records.

back to same old

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

Click here to load this message in the networking platform