Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining changed values in fields
Message
De
29/08/2003 12:24:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
29/08/2003 12:17:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00824599
Message ID:
00824605
Vues:
22
>I have a form with many many fields. I use table buffering and tableupdate to commit the changes if a field value has been changed. Using getfldstate() I can determine if a field has had activity I need to determine which field has changed and the previous and new values are for use later.
>
>I am thinking of storing the old value in a form property from gotfocus() and new value in another form property from lostfocus() and then compare the results and storing in a table.
>
>I am looking for a more elegant way to do this without manually creating all those form properties.
>
>Thanks in advance for any suggestions.
>Gaylen

GetFldState() will tell you whether a field or fields has / have changed - even if it reverts to its old value.

OldVal("MyField") will give you the value before the modification.

CurVal("MyField") will fetch the value from disk again (this is in case another user made a change).

Usually, you would compare MyField with OldVal("MyField"). For instance, I use this in triggers, to update another table.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform