Hàm CBool của VBScript
❮ Tham khảo VBScript hoàn chỉnhHàm CBool chuyển đổi một biểu thức thành kiểu Boolean.
Biểu thức phải là một giá trị số.
Cú pháp
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 |
Ví dụ
Ví dụ
<%
response.write(CBool(5) & "<br />")
response.write(CBool(0) & "<br />")
response.write(CBool(-5) & "<br />")
%>
Đầu ra của đoạn mã trên sẽ là:
True
False
True
Hiển thị ví dụ »❮ Tham khảo VBScript hoàn chỉnh