>This is possible only with a new native VFP :
>
>=AFLDCHANGE(aArray,[[WORKAREA|ALIAS],RECNO()])
>* return a 2 columns aArray: fieldname,changeFlag
>* changeFlag bit0 set if not === oldval
>* bit1 set if not === curval
>* === equal with null
>
>
>>I'll try to explain the problem I'm having.
>>
>>In my table I have a table rule called UpdateUserAndTime and a trigger called _ri_handler("UPDATE"). First fires the table rule. Here I check for fields which were modified and if I find that it's a true modification (e.g. not the same value put in the field) I replace LastUpdateUser and time fields and don't check for the rest of the fields. Then the trigger code fires. At the top it would be nice to check, if either of PK or FK fields are changed (since these are the fields participating in relations). If none of these fields changed, I don't need to execute the rest of the trigger's code. So, what do you think? How can I save myself from executing code twice?
>
>I understand.
>
>A 1 second idea:
>
>* add a parameter to the trigger
>- _ri_handler("UPDATE","UpdateUserAndTime")
>within _ri_handler:
>IF PCOUNT()=2 and !EVAL(m.cParam2)
> RETURN
>ENDIF
>* change the name to a more generic name
>UpdateCheck
>
I tried to add this logic, but it slowed down the procedure considerably. I guess, I better not put it then.
If it's not broken, fix it until it is.
My Blog