VBScript CBool関数
完全な VBScript リファレンスマニュアル
CBool 関数は式をブール(Boolean)型に変換します。
式は数値である必要があります。
構文
CBool(expression)
| 引数 | 説明 |
|---|---|
| expression | 必須です。任意の有効な式。ゼロ以外の値は True を返し、ゼロは False を返します。式が数値として解釈できない場合は、ランタイムエラーが発生します。 |
例
例
<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 リファレンスマニュアル その他の拡張