Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When to use curval() or oldval()
Message
From
27/01/2005 19:04:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
27/01/2005 18:49:39
Ricardo Giron
Secrex Compañía de Seguros de Crédito
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981566
Message ID:
00981568
Views:
30
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform