Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eof() or found()
Message
 
To
17/12/2004 20:08:50
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:
00970290
Views:
13
>>I would agree with most of the others here and say that FOUND() is the better choice. >SET NEAR ON can break the use of EOF() whereas FOUND() will always be accurate.
>
>Jim
>Do you mean to say that if "Set Near" is set ON and if you are trying to seek partial variable, "If not eof()" will be .T. but found() will be .F. ???
>Shafid

No, I mean to say that if SET NEAR is ON then any logic that expected EOF() to indicate whether or not a record was found will fail because EOF() will not go true when no record is found. EOF() being .T. is not an indicator of seek failure when SET NEAR is ON.

The real problem is that you may have code that uses IF EOF() to indicate that the SEEK failed and then that code may7 get called from someoneelse's code that SETs NEAR ON without you knowing it, oops.

EOF() tells you whether or not the record pointer is at EOF() and FOUND() tells whether or not a seek or locate succeeded. Use the function that is designed for the job you are asking it to do.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform