Latest web development tutorials

VBScriptのIsNumeric関数機能

VBScriptのリファレンス 完全なVBScriptのリファレンス

IsNumeric関数関数は、指定された式が数値として算出することができるかどうかを示すブール値を返します。 番号などの表現は、そうでなければFalse、Trueをリターンを計算する場合。

注:式が日付である場合は、IsNumeric関数関数はFalseを返します。

文法

IsNumeric(expression)

参数 描述
expression 必需。一个表达式。

<script type="text/vbscript">

Dim x
x=10
document.write(IsNumeric(x) & "<br />")
x=Empty
document.write(IsNumeric(x) & "<br />")
x=Null
document.write(IsNumeric(x) & "<br />")
x="10"
document.write(IsNumeric(x) & "<br />")
x="911 Help"
document.write(IsNumeric(x))

</script>

上記の出力の例:

True
True
False
True
False

»をお試しください

VBScriptのリファレンス 完全なVBScriptのリファレンス