I'm not sure I fully understand what you're trying to do.
You want to update the file's date/time if there are undeleted records?
If you have a big table and set deleted is on, GO 1 / GO TOP can be very slow. I think the best thing you can do is:
SET DELETED OFF
USE XXXX
IF RECC()>0
LOCATE FOR NOT DELETED()
IF NOT EOF()
LOCAL m.lcField
m.lcField = FIELD(1)
REPLACE &lcField. WITH &lcField.
ENDIF
ENDIF
USE
>That seems like a good one. For that matter, I wonder if you could just say:
>Update yourtable set field1=field1 where .F.
>I wonder if it would still change the file's timestamp by just doing that?
>
>>
>>Update yourtable set field1=field1 where Recno()=1
>>
>>>Is there a way more efficient than this (assuming no records are marked for deletion in normal use, and that if zero records, then there is not need for the TOUCH)?
>>>USE XXXX
>>>If RECC()>0
>>> GOTO 1
>>> DELETE
>>> RECALL
>>>ENDIF
>>>USE
>>>
>>>Thanks!