Fungsi VBScript CBool
CBool berfungsi untuk mengkonversi ekspresi ke Boolean (Boolean) jenis.
Ekspresi harus menjadi nilai numerik.
tatabahasa
CBool(expression)
参数 | 描述 |
---|---|
expression | 必需。任何有效的表达式。非零的值返回 True,零返回 False。如果表达式不能解释为数值,则发生 run-time 错误。 |
contoh
contoh
<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>
Contoh output di atas:
True
False
True
False
True
Coba »
Lengkap VBScript Referensi