Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to detect user change in text field
Message
De
27/01/1999 19:14:57
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
27/01/1999 12:17:11
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00180708
Message ID:
00181111
Vues:
10
>I am using buffering, but in this app it is possible that the user will change the value in the field several times. As I understand it, OLDVAL() returns the value that you got when you started the screen. This means recalculation would fire every time the current value in the textbox was compared to oldval() (assuming the user had made a change). When exactly does the control update the underlying field or variable???

I've had couple of forms like that, and I've solved it by having all the controls supplied with the .OldVal property, which was filled with .value upon navigation or just blanked on a new record. I used that just to keep the old value, in case user wanted to revert, or if I wanted to do incremental calculations of totals (something like Replace grand.total with grand.total+this.value-this.oldvalue).

Another solution would be to have an unbound control, which then behaves almost like a memory variable (just assign it the value of the field when you get to a new record or just before editing), and the value in the field will remain untouched until you update it in code.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform