Visual Basic Language Reference  

Boolean Data Type

Boolean variables are stored as 16-bit (2-byte) numbers, but they can only be True or False. Use the keywords True and False to assign one of the two states to Boolean variables.

When numeric data types are converted to Boolean values, 0 becomes False and all other values become True. When Boolean values are converted to numeric types, False becomes 0 and True becomes -1.

Note   You should never write code that relies on equivalent numeric values for True and False. Whenever possible, you should restrict usage of Boolean variables to the logical values for which they are designed. If it is necessary to mix Boolean and numeric values, be sure to use the appropriate conversion keywords.

The equivalent .NET data type is System.Boolean.

See Also

Data Type Summary | Boolean Structure | Integer Data Type | Type Conversion Functions | Conversion Summary | Efficient Use of Data Types