Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 and null values and NVL()
Message
 
 
To
24/07/2006 13:58:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01139317
Message ID:
01139323
Views:
27
Looks like it works without it too for TRUE case, though I would assume to give an error instead.
ll=.t.
ll=null
=messagebox(iif(ll,"True","False"))

ll=.f.
ll=null
=messagebox(iif(not ll,"False","True"))
In other words, I would stay with NVL to give exact result.


>Is there anytime that a field which allows nulls would generate an error on the code:
>
>
>IF myfield.myvalue  && is the value .t.?
>
>
>The field value can be .T., .F., or null
>
>It is never generating an error, but I have always had the code:
>
>
>IF (NVL(myfield.myvalue,.F.))
>
>
>and am wondering if the NVL() is guaranteed to not be necesssary? I have tested the speed difference
>and even with over a million records the NVL() speed difference appears negligible. At onetime the
>NVL() was added to all fields (all types char, date, log, etc) as a safety check more or less.
>
>TIA,
>Tracy
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform