How to: Hold True and False Values in a Variable (Visual Basic)
A variable holds true and false values if you declare it to be of data type Boolean.
A variable of the Boolean Data Type (Visual Basic) can hold two-state logical values such as true/false, on/off, and yes/no.
If you need to hold numeric values, use a numeric data type such as Integer or Double instead of Boolean. You should never use Boolean values as numbers, and you should never rely on equivalent numeric values for them. For more information, see Troubleshooting Data Types (Visual Basic).
To hold true and false values in a variable
Declare the variable with a Dim Statement (Visual Basic).
Follow the variable name with an As clause.
Follow the As keyword with the Boolean keyword.
See Also
Tasks
Troubleshooting Data Types (Visual Basic)
Reference
Data Type Summary (Visual Basic)
Single Data Type (Visual Basic)
Boolean Data Type (Visual Basic)
Integer Data Type (Visual Basic)
Double Data Type (Visual Basic)
Concepts
Type Characters (Visual Basic)