Description:
Returns an expression that has been converted to the value of the Boolean type.
Syntax:
Boolean CBool(Variant expression)
Parameters:
expression | (Variant) Any valid expression. |
---|
Note:
If expression is zero, then returns the false value, otherwise returns the true value. If expression cannot be interpreted as a numeric value, then a runtime error occurs.
Example:
VBScriptSelect and copy to clipboard
Dim A, B, Check
A = 5
B = 5
Check = CBool(A = B)
' Check contains true
A = 0
Check = CBool(A)
' Check contains false