Does anyone here use VB.NET and have a strong preference for or against using Not foo Is Nothing as opposed to foo IsNot Nothing? If so, why?
Not foo Is Nothing
foo IsNot Nothing
Using VB 7.0
If var1 Is Not Nothing Then
generates an "invalid use of object error" as per this "VBForums" link.
If var1 IsNot Nothing Then
generates a "Compile error: Expected: Then or GoTo"
If Not IsNothing(var1) Then
worked like a champ