Spot the Bug! Much ado about Nothing Part 2! (Jonathan Aneja)
Posted by: The Visual Basic Team,
on 06 Nov 2009 |
View original | Bookmarked: 0 time(s)
In yesterdays post we saw that the use of the wrong comparison operator with Nothing in an If block can lead to surprising results. Lets look at a slightly different case today:
Dim x As Integer = Nothing
If x = Nothing Then
MsgBox("A true statement - we land here")
Else
...