Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When to use curval() or oldval()
Message
De
27/01/2005 19:04:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
27/01/2005 18:49:39
Ricardo Giron
Secrex Compañía de Seguros de Crédito
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00981566
Message ID:
00981568
Vues:
25
>I have a form where one user updates data. After I have evaluated, with getfldstate(), i found that the field had changed, i want to use de old value
>to substract this old value and add the new value.

I think you should use oldval() in this case.

oldval() gets the value from the buffer, before doing the change.

curval() is used to get the value currently saved on disk: it is fetched from disk again. This can be different from oldval(), only if another user (or another form, or another copy of the application) made changes in the meantime. However, this should normally be detected as a conflict; for safety (for data integrity), the user should not be allowed to save in the case of a conflict.
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