Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem updating field - Cannot update cursor?
Message
De
24/11/1999 13:09:34
 
 
À
24/11/1999 12:51:59
Bill Totten
William Totten & Associates, Inc.
Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00294761
Message ID:
00295134
Vues:
23
>SCAN always reselects the right work area (the one the loop started in) when it reaches ENDSCAN, so you don't need to reselect even if you've changed work areas inside the loop. We know a lot of people who do so anyway. There doesn't appear to be a performance penalty for this, so if you're the belt-and-suspenders type, go right ahead.
>

Did a little testing, and the perfomance difference is there: (test table has 220000 records)
lnSeconds = SECONDS()
SELE Table1
SCAN
	SELECT Table2
	SELECT Table1
ENDSCAN
?SECONDS() - lnSeconds

Average over 10 runs: 5.820 seconds

<PRE>
lnSeconds = SECONDS()
SELE Table1
SCAN
	SELECT Table2
ENDSCAN
?SECONDS() - lnSeconds

Average over 10 runs: 5.640 seconds
You're right, the difference is nearly negligible, but it's there.

I guess it boils down to a coding preference, but I subscribe to Steve McConnell's theory:

Your program is complete when it does what is needed, and you can't take out any more code without breaking it.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform