Fungsi VBScript CBool

Referensi VBScript Lengkap

Fungsi CBool ​​mengubah ekspresi menjadi tipe Boolean.

Ekspresi harus berupa nilai numerik.

Sintaksis

CBool(expression)
Parameter Description
expression Required. Any valid expression. A nonzero value returns True, zero returns False. A run-time error occurs if the expression can not be interpreted as a numeric value

Contoh

Contoh

<%

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

%>

Output dari kode di atas akan menjadi:

True
False
True

Referensi VBScript Lengkap