Logical, Bitwise, and Shift Operators

Visual Basic 2015 offers logical, bitwise, and shift operators. Logical operators are special operators that enable comparisons between Boolean values and return Boolean values. Bitwise and shift operators enable performing operations bit by bit. Next let’s discuss both logical and bitwise operators.

Logical Operators

Visual Basic 2015 has eight logical/bitwise operators: Not, And, Or, Xor, AndAlso, OrElse, IsFalse, and IsTrue. In this section you’ll learn about the first four; the other ones are covered in the next section. The first operator, Not, returns the opposite of the actual Boolean value. For example, the following lines of code return False because, although the 43 number is greater than 10, ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.