Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to detect user change in text field
Message
From
27/01/1999 19:14:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
27/01/1999 12:17:11
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00180708
Message ID:
00181111
Views:
11
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform