boolean VB expression returning false for integer 1
- by Bill
This is probably a really basic (no pun intended) question, but I can't seem to find an answer anywhere. Why does the result of func1 return False and func2 returns True? On every other test I have done, integer 1 is converted to boolean true and 0 to false. Works ok if I just set rtnValue to 1 or 0.
Public Function func1() As Boolean
Dim rtnValue As Integer = 0
Return rtnValue = 1
End Function
Public Function func2() As Boolean
Dim rtnValue As Integer = 0
Return rtnValue = 0
End Function