Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan Endscan
Message
De
24/06/2005 13:27:34
 
 
À
24/06/2005 12:50:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01026363
Message ID:
01026376
Vues:
25
>Hi All. I have been reading some threads about SCAN - ENDSCAN. Due to old habits I have used DO WHILE but am interested in the speed improvements that SCAN ENDSCAN appear to offer.
>
>Any gotchas to watch out for when converting DO WHILE loops to SCAN ENDSCAN? I did read Dragan's comment about nested SCAN's on the *same* file. Are there any others?


hi Jos

i have never considered using a "Do While" in place of a Scan, but i have tested a scan loop to a SQL against a well indexed table with about 90000 records.

the scan looked something like this:
sele MyTable
set order to MyIndex
seek MySeekExp
scan rest while MyTable.Field1 = MySeekExp
   ...
endscan
the sql was something like this:
sele q_a.* from MyTable q_a where MyTable.Field1 = MySeekExp into cursor cur_MyTest
the speed difference was very small - almost the same. however, when run a comparisen with a 'complex' sql command (like an sql within an sql) - the sql became so 'slow', that the scan was faster. I tested this in Vfp6 SP5.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform