Boolean Data Type
from String to Boolean when type conversion only "True" , "False" and numbers can be converted to Boolean Type , all other types will have an error.
For example, if you execute the following code, an error occurs: The conversion from the string "" to the Type "Boolean" is invalid.
Dim Test as Boolean
Test = CBool ("")
The following is quoted from: msdn.microsoft.com
A Boolean variable is stored as a numeric value of 16 bits (2 bytes), but only True or False. Use the keyword True and False to assign a boolean variable to one of these two states.
When you convert a numeric data type to a boolean value, 0 converts to False, and all other values are converted to True. When you convert a Boolean value to a numeric type,False converts to 0, andTrue converts to-1.
Attention The ToInt32 method of the convert class in the System namespace converts True to +1. If you need to convert a Boolean value to a numeric data type, note the conversion method that you are using.
warning never write code that relies on the equivalent value of True and False . Whenever possible, you should limit the use of Boolean variables as logical values, which is the purpose of designing a boolean variable. If you need to mix Boolean and numeric values, be sure to use the appropriate conversion keywords.
The equivalent. NET data type is System.Boolean.
Reference URL: http://msdn.microsoft.com/zh-cn/library/cc437484 (vs.71). aspx