IIF in vb.net acts weird.. or is it me

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance





Hi all,

why in the world would this fail ( throw an exception)


Dim str As String = ""

MsgBox(IIf(IsNumeric(str), Convert.ToInt32(str).ToString, str))

Why does it try to evaluate the true part when the condition is false.

Or am i missing something here.

Thanks in advance.

.



Relevant Pages