Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF() bug or feature?
Message
 
 
To
09/02/2011 11:38:10
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01499384
Message ID:
01499395
Views:
71
This message has been marked as the solution to the initial question of the thread.
>Hi,
>I have DevideByZero exception in expression when LN_QTY=0D
>
>LN_RESULT = IIf(LN_QTY > 0D, LN_SUM / LN_QTY, -1D)
>
>I expect function return me -1D, but so far as I see, VB compiler evaluate every expression not depends from logical rule?
>
>Is it bug or feature? Is the same in C# ?
>
>Thanks
>Denis

There is another form of IF in VB which is the shortcut. IIF evaluates all expressions.

See this blog post
http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/VBNET/if-and-iif
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