CBool: convert Integer to Boolean : Boolean « Data Type « VB.Net Tutorial






Module Tester
    Public Sub Main()
        Dim iBoolean As Integer = -1
        Dim bBoolean As Boolean = CBool(iBoolean)
        Console.WriteLine("Boolean of {0} is {1}", iBoolean, bBoolean)
    End Sub

End Module
Boolean of -1 is True








2.16.Boolean
2.16.1.Define Boolean value and use it in If statement
2.16.2.Boolean value calculation: Or, Xor, And, Not
2.16.3.CBool: convert Integer to Boolean
2.16.4.CBool(0): convert 0 to Boolean