Hi Cetin,
>>>>>
>>>>>I have a table in optimistic Table buffered mode. When my form is in EditMode, I can edit records, then I want to save my changes. I issue TableUpdate. My question is: how can I determine, which records were actually updated? I want to replace modidate field with datetime() for these particular records.
>>>>>
>>>>> Could it be done in Update trigger instead, if this table is a part of database? I rare use triggers, so I'm not sure, how would it be done...
>>>>>
>>>>> Thanks in advance.
>>>>
>>>>
Nadya,
>>>>Check getnextmodified() and fldstatus().
>>>>Cetin
>>>
>>>
Ooops. Peter's is correct. It's getfldstate() not fldstatus() :)
>>>Cetin
>>
>> I'm currently use GetNextModified(0) to determine, if I made some changes.
>> So, the procedure should looks like:
>>
>>
>> lnRecno=0
>> do while .t.
>> lnRecno=GetNextModified(lnRecno)
>> if lnRecno>0
>> go lnRecno
>> replace modidate with datetime()
>> else
>> * there are no modified records left
>> exit
>> endif
>> enddo
>>
>> Right? I just create this code, haven't tested yet...
>
>
Nadya,
>Gee tagged code is hard to strip:)Similar but not quite. getnextmodified() would return negative values for "appended" records.
>
>
> lnRecno=GetNextModified(0)
> do while lnRecno#0
> if lnRecno>0
> go lnRecno
> replace modidate with datetime()
> else
> * record was appended
> * if not default datetime inserted do it for it too
> endif
> lnRecno=GetNextModified(lnRecno)
> enddo
Cetin
Cetin & Peter,
Thanks a lot for your help.
If it's not broken, fix it until it is.
My Blog