December 2001
Beginner
976 pages
22h 4m
English
The boolean or logical operators are commonly used to combine Boolean values or expressions into more complex Boolean expressions. For example
Dim i As Integer = 3, j As Integer = 5, b As Boolean b = i < 5 And j >= 6 ' b is False
The comparison expressions i < 5 and j >= 6 are combined by the logical operator And. And has the exact meaning as in English: if both comparison expressions (i < 5 and j >= 6) are true, the result is True. If at least one of the expressions is false, the result of the logical And operation is False. This result will be assigned to the Boolean variable b.
Visual Basic also has an Or logical operator, which is the equivalent of the English meaning of the word “or”. Here is the same example as before: ...
Read now
Unlock full access