VBScript TypeName関数
定義と使用方法
TypeName関数は変数のサブタイプを指定できます。
TypeName関数が返す値:
値 | 説明 |
---|---|
Byte | バイト値 |
インテジャー | 整数値 |
Long | 長整数値 |
シングル | 単精度浮動小数点値 |
ダブル | 双精度浮動小数点値 |
Currency | 通貨値 |
Decimal | 十進値 |
Date | 日付または時間値 |
ストリング | 文字列値 |
ボールルーン | ボールルーン値;TrueまたはFalse |
空 | 初期化されていません |
なし | 有効なデータがありません |
<object type> | 実際のオブジェクトタイプ名 |
オブジェクト | 一般的なオブジェクト |
未知 | 未知のオブジェクトタイプ |
ナシ | オブジェクトインスタンスが参照されていないオブジェクト変数 |
エラー | エラー |
構文
TypeName(varname)
パラメータ | 説明 |
---|---|
varname | 必須。変数の名前。 |
例
dim x x="Hello World!" document.write(TypeName(x)) x=4 document.write(TypeName(x)) x=4.675 document.write(TypeName(x)) x=Null document.write(TypeName(x)) x=Empty document.write(TypeName(x)) x=True document.write(TypeName(x))
出力:
ストリング インテジャー ダブル なし 空 ボールルーン