It's faster to SET ORDER in separate command. When you use ORDER clause in USE command in addition to setting order VFP also moves pointer to the first record in that order. It can take additional time.
USE names
SET ORDER TO code
>
>cCode="KHAN"
>Use names order code
>If Seek(cCode)
> ?yes
>Else
> ?no
>Endif
>
>>Hi Tore, Can please give me an example of seek() for this code :
>>
>>Local cCode
>>cCode="KHAN"
>>sele 0
>>use invoice
>>set order to code
>>sele 0
>>use names
>>set order to code
>>
>>sele names
>>seek cCode && this is what I do now
>>if found()
>> ?yes
>>else
>> ?No
>>endif
>>
>>sele invoice
>>seek cCode
>>
>>..
>>..
>>Many thanks.
>>Shafid
--sb--