﻿'Visual Basic 2012 Boolean Datatype en Booleaanse Expressies Boolean Datatype en Booleaanse Logica Module BooleanDatatypeExample1 Sub Main() Console.WriteLine("Value 1 ?") Dim value1 As Integer = Console.ReadLine() ' Console.WriteLine("Value 2 ?") Dim value2 As Integer = Console.ReadLine() ' Dim value1Higher As Boolean = value1 > value2 ' If value1Higher Then Console.WriteLine(value1 & " > " & value2) Else Console.WriteLine(value1 & " <= " & value2) End If ' Console.ReadLine() End Sub End Module Module BooleanDatatypeExample2 Sub Main() Console.WriteLine("Value 1 ?") Dim value1 As Integer = Console.ReadLine() ' Console.WriteLine("Value 2 ?") Dim value2 As Integer = Console.ReadLine() ' Dim equal As Boolean = value1 = value2 ' (1) ' If equal Then Console.WriteLine(value1 & " = " & value2) Else Console.WriteLine(value1 & " <> " & value2) End If ' Console.ReadLine() End Sub End Module Module DefaultValuesAndLiteralsExample Sub Main() Dim integerVariable As Integer Console.WriteLine("Integer default value : " & integerVariable) integerVariable = 5 Console.WriteLine("Integer changed value : " & integerVariable) ' Dim stringVariable As String Console.WriteLine("String default value : " & stringVariable) stringVariable = "text" Console.WriteLine("String changed value : " & stringVariable) ' Dim booleanVariable As Boolean Console.WriteLine("Boolean default value : " & booleanVariable) booleanVariable = True Console.WriteLine("Boolean changed value : " & booleanVariable) booleanVariable = False Console.WriteLine("Boolean changed value : " & booleanVariable) ' Console.ReadLine() End Sub End Module 'Bezoek www.vbvoorbeelden.be voor meer Visual Basic voorbeelden. 'Copyright - De Wolf / vbvoorbeelden - 2003-2012 - Alle rechten voorbehouden.