ฟังก์ชันVBScript CBool
❮ การอ้างอิง VBScript ที่สมบูรณ์ฟังก์ชัน CBool จะแปลงนิพจน์เป็นประเภทบูลีน
นิพจน์ต้องเป็นค่าตัวเลข
ไวยากรณ์
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 |
ตัวอย่าง
ตัวอย่าง
<%
response.write(CBool(5) & "<br />")
response.write(CBool(0) & "<br />")
response.write(CBool(-5) & "<br />")
%>
ผลลัพธ์ของโค้ดด้านบนจะเป็น:
True
False
True
❮ การอ้างอิง VBScript ที่สมบูรณ์