Define Boolean value and use it in If statement : Boolean « Data Type « VB.Net Tutorial






public class Test
   public Shared Sub Main


        Dim blnStatus As Boolean = True
        Console.WriteLine(blnStatus)

        blnStatus = Not blnStatus
        Console.WriteLine(blnStatus)

        If blnStatus Then
            Console.WriteLine("The status is true.")
        Else
            Console.WriteLine("The status is false.")
        End If


   End Sub
End class
True
False
The status is false.








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