Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CURVAL() & OLDVAL() Returning NULL
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00569174
Message ID:
00569429
Views:
47
Hi!

This probably was a new record added in the table, right? OLDVAL() does not return value that was prior last change. It returns the value that was in the table just after you retrieved record from the table (before ANY changes in the field). CurVal() does return phisical value from the table. If another user from network (or another VFP application instance) changed the value in that field, curVal() will return that changed value (for views, to get the last change you require to use refresh()). For new records both OldVal() and CurVal() return NULL. You can use GetFldState() function to see if field was changed at all and if the record is new.

You cannot use curval() and oldval() for interface to track the change of the field in the control compare to what value was in the field before control gets focus. You require to organize this manually, for example, add new property to the control class and in the GotFocus event store this.value in that property.

Let me know if anything above apply to what you ask.


>CURVAL() and OLDVAL() are both returning NULL. I know the OrdQty
>field was changed prior to this code being run, and was not yet
>committed. I'm using optimistic table buffering.
>
>Here's my code:
>
>LOCAL nOrigQty, nNewQty
>
>nOrigQty = OLDVAL("OrdQty", "LineItems")
>nNewQty = CURVAL("OrdQty", "LineItems")
>

>
>If I enter 'LineItems.OrdQty' into the debugger, it correctly displays
>the new value. Anyone know whats going on here?
>
>Thanks
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform