Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem updating field - Cannot update cursor?
Message
From
24/11/1999 13:09:34
 
 
To
24/11/1999 12:51:59
Bill Totten
William Totten & Associates, Inc.
Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00294761
Message ID:
00295134
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform