O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Boolean Data Type

The data type Boolean saves binary states, which means it doesn’t save much. Its value can be False or True—it can’t save anything else. This data type is most frequently used when running conditional program code (you saw the basics of conditional code in Chapter 1).

.NET data type: System.Boolean

Represents: One of two states: True or False.

Type literal: Not available

Memory requirements: 2 bytes

Note: To define a Boolean variable, use the keywords True and False directly and without quotes in the program text, such as in the following example:

Dim locBoolean As Boolean
locBoolean = True 'Expression is true.
locBoolean = False 'Expression is false.

Converting to and from Numeric Data Types

You can convert a Boolean type to a numeric ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required