Top > VBScript > VarType


VarType( ? )

Option Explicit

Dim strAry
Dim strDate
Dim strEmpty
Dim strNull
Dim strNum
Dim strNum2
Dim strNum3
Dim strObj
Dim result
Dim strNon

strAry = Array( "acha" , "porute" , "piipo" )
strDate = Now
strEmpty = Empty
strNull = Null
strNum = 1.618033
strNum2 = "1.618033"
strNum3 = "1.618033acha"
Set strObj = CreateObject("WScript.Shell")

WScript.Echo "Type = " & VarType( strAry )    ' Type = 8204
WScript.Echo "Type = " & VarType( strEmpty )  ' Type = 0
WScript.Echo "Type = " & VarType( strNull )   ' Type = 1


定数説明
0 vbEmpty Empty
1 vbNull NULL
2 vbInteger 整数
3 vbLong 整数(LONG)
4 vbSingle 小数(Single)
5 vbDouble 少数(Duble)
6 vbCurrency 通貨
7 vbDate 日付
8 vbString 文字列
9 vbObject オブジェクト
10 vbError エラー
11 vbBoolean ブール
12 vbVariant バリアント
13 vbDataObject 非オートメーションオブジェクト
17 vbByte バイト
8024 vbArray 配列

…配列の値がMicroSoftの情報と違うのが気になりますが、、、
MSDN:VarType 関数



Copyright © 2015 AchaPorutePiipo All Rights Reserved.