ฟังก์ชันVBScript IsNumeric
❮ การอ้างอิง VBScript ที่สมบูรณ์
ฟังก์ชัน IsNumeric ส่งคืนค่าบูลีนที่ระบุว่านิพจน์ที่ระบุสามารถประเมินเป็นตัวเลขได้หรือไม่ คืนค่า True หากนิพจน์เป็นที่รู้จักว่าเป็นตัวเลข มิฉะนั้นจะส่งกลับค่าเท็จ
หมายเหตุ:ถ้านิพจน์เป็นวันที่ ฟังก์ชัน IsNumeric จะคืนค่าเป็นเท็จ
ไวยากรณ์
IsNumeric(expression)
Parameter | Description |
---|---|
expression | Required. An expression |
ตัวอย่าง
ตัวอย่าง
<%
Dim x
x=10
response.write(IsNumeric(x) & "<br />")
x=Empty
response.write(IsNumeric(x) & "<br />")
x=Null
response.write(IsNumeric(x) & "<br />")
x="10"
response.write(IsNumeric(x) & "<br />")
x="911 Help"
response.write(IsNumeric(x))
%>
ผลลัพธ์ของโค้ดด้านบนจะเป็น:
True
True
False
True
False
❮ การอ้างอิง VBScript ที่สมบูรณ์