Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLDVAL() returns .NULL. question.
Message
From
28/01/2003 07:12:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/01/2003 06:23:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00746128
Message ID:
00746136
Views:
17
This message has been marked as the solution to the initial question of the thread.
>Hi!
>
>I have been debugging a problem with Oldval(). On a newly appended record in a row buffered view, that has not been committed yet, when applying OldVal() (in program code) to numeric field that has had a value entered by the user, OldVal() returns .NULL.
>
>Is this correct? OldVal() helps mentions nothing about this and specifies that the function returns a value commensurate with the column's data type.
>
>If I go to the command window and browse the view, OldVal() returns the present value of the field but I assume that browsing the view committed the record hence the old value equals the current value.
>
>Any insight on this will be appreciated.
>
>Many thanks!


It's true. Oldval() for a new uncommitted field is null.
In a row buffered table leaving the row implicitly commits.
PS:Comparisions like if oldval(...) = 0 would fail. Instead nvl(oldval(...),0) works.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform