Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eof() or found()
Message
From
17/12/2004 13:11:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00970039
Message ID:
00970121
Views:
12
>hi all,
>i know that its not the most important thing in the world but i was wondering what was the better/faster code to use when searching a table using a locate command (no index for seek), if eof() OR if found().
>Slán
>~M

If you do not have to use CONTINUE, then:
SCAN it is faster, and for a single field LOOKUP() it is 100% faster
YOU CAN CHANGE
LOCATE XXXX
IF FOUND()
   YYYY
ENDIF
WITH
SCAN XXXX
   YYYYY
   EXIT
ENDSCAN
* ATTENTION, ENDSCAN restore the SCAN workarea
OR
SCAN XXXX
  EXIT
ENSCAN
IF !EOF()
 YYYY
ENDIF
or for a single field
IF LOOKUP() AND !EOF()
  YYYY
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform