Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursive loop and SCAN
Message
De
27/07/2002 01:31:14
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
27/07/2002 00:57:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00683191
Message ID:
00683220
Vues:
35
>>It could also break some code relying on Scan NOT restoring the record pointer.
>
>Wouldn't it be some bad design or some bad use of the SCAN functionality? :) Yes, I also thought about the same. But, to me, someone who uses SCAN should SCAN as per the SCAN condition.

Right - but then recursive scan wasn't in the original spec either. Still, we've seen two good ways to do it.

>>This is the way it worked ever since Scan was introduced. Alternately, you could do what Sergey meant:
>
>The problem with that is that would open too much new aliases. Basically, what I did by restoring the pointer is the best way in my situation.

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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform