Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changes in Data
Message
De
06/01/2000 07:37:57
 
 
À
06/01/2000 07:20:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00313813
Message ID:
00313816
Vues:
43
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
Fil
Voir

Click here to load this message in the networking platform