VBScriptIsNumeric関数_
❮完全なVBScriptリファレンス
IsNumeric関数は、指定された式を数値として評価できるかどうかを示すブール値を返します。式が数値として認識される場合はTrueを返します。それ以外の場合は、Falseを返します。
注:式が日付の場合、IsNumeric関数はFalseを返します。
構文
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リファレンス