Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK vs =SEEK
Message
From
22/07/2003 19:40:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00812589
Message ID:
00812592
Views:
14
This message has been marked as the solution to the initial question of the thread.
>I am confused. The code has a =SEEK('table','value','index) followed by IF FOUND(). The SEEK finds a key match but the FOUND is not triggered. Is it because of the =SEEK. What does the = do anyway.
>
>Thanks
>
>Brenda

The SEEK command requires that the table you want to do the seek in is the the current workarea and that the proper index tag is set beforehand. The SEEK() function allows you to specify a different table and/or index from the current one to do the seek. Both should set the FOUND() status correctly, but in the case of using the SEEK() function, you may also need to specify the alias parameter to the FOUND() function.

USE table1 ORDER TAG field1
SEEK "Smith"

FOUND() or FOUND("table1") should give proper results.


USE table1 ORDER TAG field1
USE table2 ORDER TAG fieldx IN 0
SELECT table2
=SEEK("table1","Smith","field1")

In this case, FOUND() could produce a bad result because the current area is for table2, and the seek took place in table1. FOUND("table1") should yield correct results, or switching to table1 first would allow the FOUND() to be correct.


The "=" is required becasue of there being both a SEEK command and a SEEK() function to distinguish them from each other
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform