Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding last entered value in valid event, how to?
Message
From
08/06/2008 01:16:50
 
 
To
07/06/2008 18:58:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01322235
Message ID:
01322353
Views:
15
>>>>
>>>>I have a field whose oldval() is A1.
>>>>Let say user change it to A2 then A3 then A4 (multiple time before saving the record)
>>>>
>>>>In the valid event, when user key in A3, how do I know (programatically) the last entered value A2, similary, when user inputs A4, I need to know the last entered value A3.
>>>>
>>>>Is VFP equiped with something to find out the last entered value?
>>>
>>>No but you can build such functionality into your control base class by adding a 'Lastvalue' property and populate it at appropriate time.
>>
>>Thanks!
>>Hard to believe VFP does not have this feature... anyway, I trust you :)
>
>It's a rare requirement, but can be easily coded - your controls need to have an array or collection property which will store a new value on each .valid() (or .lostfocus() - your choice) and will be cleared on save. Then you'll have a way of undoing and redoing changes.

I don't need a list of all entered values but only the last entered value. (Please see my reply to Sergey Berezniker). It seems to be easy, I was thinking it the same way as you. But I later found that, it is not only "save" that matters (to clear the last value I have stored to a property of the input control, say a textbox). Imagine, my entry form allow user to navigate through records with a [Next] and [Previous] button. User might give up saving a rec when moving to the next, in this case, still whatever "last entered value" stored has to be cleared.

I was once try to store the "last value" in gotfocus event, but then later reliaze gotfocus has several different triggers other than the normal user click the control or tab to the control. E.g. when new value is picked from a picklist, the gotfocus will be fired when returned from the picklist. So new value picked become "last entered value"...

I got this feeling, if the mechanism that I develop to store "last entered value" is free from form or its input control, rather it is underlying source field dependent, then it will be a perfect solution... unfortunately, I find that beyond my capability, that is why, my best dream is VFP already has this feature :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform