Hi Naomi,
Your answer is usefull for me!
Nice to know exist if() instead iif() :))))
what the reason to have IIF() then? In which case I must use IIF() ?
Thanks
Denis
>>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