Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locate for variable sometimes returns an error
Message
From
02/02/2004 08:13:42
 
 
To
02/02/2004 06:11:11
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00872876
Message ID:
00872893
Views:
16
Hi Mike,

>Is it possible there is code in a timer control that is changing the workarea?
A vfp-timer shouldn't fire during vfp code execution.
"Interrupting" operations should only be possible by c++ timers
or callback functions.

>What is the alias() when the error occurs?
The alias() should be customer,
but perhaps another table was opened with that alias.
Checking like:
if fsize("clientnr") > 0
  Locate for clientnr=5
else
  StrToFile(alias() + ":" + dbf(), "MyProt")
endif
might help if there is no errorhandler giving this info.


>SEEK is faster than LOCATE and continues to be fast as the number of records grows.
On tables with very few records locate without index will beat seek().
On the first run on tables with many records seek() will probably always be faster.

>IMO LOCATE is better for more complex conditions and for processing sets of records.
Here I believe that locate might get faster if called again:
AFAIK Seek will traverse the .cdx every time, while locate will reuse already found
optimizing info. So for some readonly scenarios it might actually become
faster than seek().

my 0.02 EUR

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform