Logical, Bitwise and Shift Operators

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

Logical Operators

In Visual Basic 2010, there are eight logical/bitwise operators: Not, And, Or, Xor, AndAlso, OrElse, IsFalse, IsTrue. In this subsection you learn about the first four, while the other ones will be covered in the next subsection. The first operator, Not, basically returns the opposite of the actual Boolean value. For example, the following lines of code return False because although the ...

Get Visual Basic® 2010 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.