Consider the following VB.NET code:
Sub ObjectTest()
Dim active As Object = Nothing
If active = False Then
Console.WriteLine("false")
End If
If active = True Then
Console.WriteLine("true")
End If
If active = Nothing Then
Console.WriteLine("nothing")
End If
End Sub
the output I get on the console is
false
nothing
This means
If active = False
is succeeding. How can this be? active is set to nothing so how can it be false? It is not false, it is nothing. We know this because the
If active = Nothing
condition succeeds.
Incidentally, if I change the code to:
Sub ObjectTest()
Dim active As Object = vbnull
If active = False Then
Console.WriteLine("false")
End If
If active = True Then
Console.WriteLine("true")
End If
If active = vbnull Then
Console.WriteLine("null")
End If
End Sub
The only output I get is "null" Clearly in VB.NET then, "nothing" does not mean "null"
What is causing the condition to think active is equal to false?