Latest web development tutorials

VBScript CBool ​​function

VBScript Reference Complete VBScript Reference

CBool ​​function to convert expressions to Boolean (Boolean) type.

Expression must be a numeric value.

grammar

CBool(expression)

参数 描述
expression 必需。任何有效的表达式。非零的值返回 True,零返回 False。如果表达式不能解释为数值,则发生 run-time 错误。

Examples

Examples

<script type="text/vbscript">

document.write(CBool(5) & "<br />")
document.write(CBool(0) & "<br />")
document.write(CBool(-5) & "<br />")

</script>

Examples of the above output:

True
False
True

try it"

VBScript Reference Complete VBScript Reference