VBScript IsNumeric 関数
定義と用法
IsNumeric 関数は、指定された表現が数字として計算できるかどうかを示す布尔値を返します。数字として計算できる場合、True を返し、そうでない場合、False を返します。
注釈:表現が日付の表現である場合、IsNumeric は False を返します。
構文
IsNumeric(expression)
パラメータ | 説明 |
---|---|
expression | 必要な。表現。 |
例
dim x x=10 document.write(IsNumeric(x)) x=Empty document.write(IsNumeric(x)) x=Null document.write(IsNumeric(x)) x="10" document.write(IsNumeric(x)) x="911 Help" document.write(IsNumeric(x))
それぞれ出力:
True True False True False