"Set key" is a kind of filter on index. It limits access to part of index. If your seek() falls in that range of "set key" then seek() returns .t. (you limit seek to a range).
ie: home()+"samples\data\customer" has country and contact indexes.
set order to tag country
set key to "GERMANY"
?seek("Janine Labrune","customer","contacts")
set key to
?seek("Janine Labrune","customer","contacts")
If applicable set key seems much faster than filter.
Cetin
>>Is show fk a filtered or unique index?
>
>No. :)
>
>
>Showfk is a foreign key to the show table and is a regular VFP index, no filter, non-unique key.
>
>In my tables there are multiple records for each show. My current application uses SET FILTER to limit records to the currently selected show. I saw another message about SET KEY and thought that maybe this would be better for what I was doing. I played around with SET KEY and found the things that I outlined in my message.
>
>I guess I thought that I could use SET KEY as a replacement for SET FILTER. From what I discovered my assumption must have been wrong or I don't understand the proper use of SET KEY.
>
>
>>>I am playing around with set key vs set filter and ran across this. I set key then seek on a different tag and it fails. I set filter and seek and it works.
>>>
>>>*Sample code
>>>use exhiinfo
>>>set order to showfk
>>>set key to 6
>>>?seek(3, 'exhiinfo', "Accnum") && fails
>>>
>>>set order to accnum
>>>* this will locate a recordd that is outside the set key range
>>>?seek(3, 'exhiinfo', "Accnum")
>>>
>>>set key to
>>>
>>>set filter to showfk = 6
>>>locate
>>>?seek(3, 'exhiinfo', "Accnum") && this works
>>>
>>>Anybody seen this before. Am I using set key wrong?