VBScript CBool Function

Definition and Usage

The CBool function can convert an expression to a boolean type.

Syntax

CBool(expression)
Parameter Description
expression Required. Any valid expression. Non-zero values return True, zero returns False. If the expression cannot be interpreted as a number, a run-time error will occur.

Instance

Example 1

dim a,b
a=5
b=10
document.write(CBool(a))
document.write(CBool(b))

The output is as follows:

True
True