VBScript 教程教程
VBScript CBool 函数
VBScript CBool 函数
VBScript CBool 函数
完整的 VBScript 参考手册
CBool 函数把表达式转换为布尔(Boolean)类型。
表达式必须是一个数值。
语法
CBool(expression)
参数 | 描述 |
---|---|
expression | 必需。任何有效的表达式。非零的值返回 True,零返回 False。如果表达式不能解释为数值,则发生 run-time 错误。 |
实例
实例
<script type="text/vbscript">
document.write(CBool(5) & "<br />")
document.write(CBool(0) & "<br />")
document.write(CBool(-5) & "<br />")
</script>
document.write(CBool(5) & "<br />")
document.write(CBool(0) & "<br />")
document.write(CBool(-5) & "<br />")
</script>
以上实例输出结果:
True
False
True
False
True
尝试一下 »
完整的 VBScript 参考手册
VBScript CBool 函数 |
---|
VBScript 教程
VBScript,即 Visual Basic Script,是微软公司开发的一种解析型的服务端(也支持客户端)脚本语言,可以看作是 VB 语言的简化版。