You can use the VFP record/table buffering system. Use a combination of the GetFldState(), curval() and oldval() functions.
The following example is lifted straight from the VFP help for GetFldState(), once you have determined whether or not a field has changed you can use curval() and oldval() functions to query their original/current values.
CLOSE DATABASES
CLEAR
SET MULTILOCKS ON && Allow table buffering
OPEN DATABASE (HOME(2) + 'data\testdata')
USE Customer && Open customer table
=CURSORSETPROP("Buffering",5,"customer") && Enable table buffering
* Get field state on original cust_id field and display state
nState=GETFLDSTATE("cust_id")
DO DisplayState WITH nState
* Change field contents and display state
REPLACE cust_id WITH "***"
nState=GETFLDSTATE("cust_id")
DO DisplayState WITH nState
* Discard table changes and display state
= TABLEREVERT(.T.) && Discard all table changes
nState=GETFLDSTATE("cust_id")
DO DisplayState WITH nState
PROCEDURE DisplayState
LPARAMETER nState
DO CASE
CASE nState=1
=MESSAGEBOX("Field has not been modified",0,"Results")
OTHERWISE
=MESSAGEBOX("Field has been modified",0,"Results")
ENDCASE
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement