>Your thoughts are appreciated but why is browse for better than set filter?
As I just wrote to Mike: Over the years I have had many problems when I used SET FILTER, so I stopped using it whenever I could. One problem was that it is easy to forget to reset it, and you end up with too few records. I don't remember the other problems, but since it's usually easier to add a FOR whatevercondition, I prefer that.
>and how would you write a locate that is equivalent to GO TOP?
Simply replace GO TOP with LOCATE. A simple LOCATE is identical to LOCATE FOR .T. which will find the first matching record. GO TOP will scan all the first records until it finds the first match,
it will also scan all the records which should be ignored due to the SET FILTER command. So if you filter a large table, and the first matching records is close to the EOF, GO TOP will take a loooong time, while LOCATE is instant.
>>I can not see what causes your problem, but I have a few advices:
>>1. Avoid SET FILTER whenever possible, instead you can use "BROWSE FOR yourcondition"
>>2. Don't use GO TOP after SET FILTER, instead use LOCATE which in many cases is extremely much faster
>>
>>>I have been having trouble lately with a browse command causing a shift in the current work area. For example:
>>>
>>>
>>>set filter to PermID == lcPermID and (LoCWW > 7 or HiCWW > 7 or LoCWWHrs > 24 or HiCWWHrs > 24)
>>>go top
>>>if ! eof()
>>> messagebox("The following records need to be corrected for CWW > 7 or CWWHrs > 24. ")
>>> browse
>>>endif
>>>set filter to
>>>
>>>brow title 'Get ready'
>>>set filter to PermID == lcPermID and upper(valid) = "NO"
>>>go top
>>>
>>>I can't imagine what's causing this unless my installation has become corrupted somehow. Has anyone else ever experienced this? This is happening throughout my application in various routines and prg's.