VBScript:VarType 值 15 和 16 代表什么?
VBScript: What do VarType values 15 and 16 represent?
对于 VBScript,“VarType(x)”函数 return 的值为 0-14、17 和 8192,其中每个值代表“x”参数的变量类型。在那个序列中,有明显的缺失值 15 和 16.
缺失值 15 和 16 代表什么类型?我需要追溯到多远的历史或多深的 VBScript 内部才能找到答案?
- 编辑 2021 年 4 月 30 日
这是我想出的扩展类型编号列表,超出了“VarType”和“TypeName”的功能 return:
CONST VT_EMPTY = &h00000000& ' 0X0000 Not specified
CONST VT_NULL = &h00000001& ' 0X0001 Null
CONST VT_I2 = &h00000002& ' 0X0002 A 2-byte integer
CONST VT_I4 = &h00000003& ' 0X0003 4-byte integer
CONST VT_R4 = &h00000004& ' 0X0004 4-byte real
CONST VT_R8 = &h00000005& ' 0X0005 8-byte real
CONST VT_CY = &h00000006& ' 0X0006 Currency
CONST VT_DATE = &h00000007& ' 0X0007 Date
CONST VT_BSTR = &h00000008& ' 0X0008 String
CONST VT_DISPATCH = &h00000009& ' 0X0009 IDispatch pointer
CONST VT_ERROR = &h0000000A& ' 0X000A SCODE value
CONST VT_BOOL = &h0000000B& ' 0X000B Boolean value; True is -1 and false is 0
CONST VT_VARIANT = &h0000000C& ' 0X000C Variant pointer
CONST VT_UNKNOWN = &h0000000D& ' 0X000D IUnknown pointer
CONST VT_DECIMAL = &h0000000E& ' 0X000E 16-byte fixed-pointer value
CONST VT_I1 = &h00000010& ' 0X0010 Character
CONST VT_UI1 = &h00000011& ' 0X0011 Unsigned character
CONST VT_UI2 = &h00000012& ' 0X0012 Unsigned short
CONST VT_UI4 = &h00000013& ' 0X0013 Unsigned long
CONST VT_I8 = &h00000014& ' 0X0014 64-bit integer
CONST VT_UI8 = &h00000015& ' 0X0015 64-bit unsigned integer
CONST VT_INT = &h00000016& ' 0X0016 Integer
CONST VT_UINT = &h00000017& ' 0X0017 Unsigned integer
CONST VT_VOID = &h00000018& ' 0X0018 C-style void
CONST VT_HRESULT = &h00000019& ' 0X0019 HRESULT value
CONST VT_PTR = &h0000001A& ' 0X001A Pointer type
CONST VT_SAFEARRAY = &h0000001B& ' 0X001B Safe array; Use VT_ARRAY in VARIANT
CONST VT_CARRAY = &h0000001C& ' 0X001C C-style array
CONST VT_USERDEFINED = &h0000001D& ' 0X001D User-defined type
CONST VT_LPSTR = &h0000001E& ' 0X001E Null-terminated string
CONST VT_LPWSTR = &h0000001F& ' 0X001F Wide null-terminated string
' 0x0020 - 0x0023
CONST VT_RECORD = &h00000024& ' 0X0024 User-defined type
CONST VT_INT_PTR = &h00000025& ' 0X0025 Signed machine register size width
CONST VT_UINT_PTR = &h00000026& ' 0X0026 Unsigned machine register size width
' 0x27 - 0x3F
CONST VT_FILETIME = &h00000040& ' 0X0040 FILETIME value
CONST VT_BLOB = &h00000041& ' 0X0041 Length-prefixed bytes
CONST VT_STREAM = &h00000042& ' 0X0042 The name of the stream follows
CONST VT_STORAGE = &h00000043& ' 0X0043 The name of the storage follows
CONST VT_STREAMED_OBJECT = &h00000044& ' 0X0044 The stream contains an object
CONST VT_STORED_OBJECT = &h00000045& ' 0X0045 The storage contains an object
CONST VT_BLOB_OBJECT = &h00000046& ' 0X0046 The blob contains an object
CONST VT_CF = &h00000047& ' 0X0047 Clipboard format
CONST VT_CLSID = &h00000048& ' 0X0048 Class ID
CONST VT_VERSIONED_STREAM = &h00000049& ' 0X0049 Stream with a GUID version
CONST VT_BSTR_BLOB = &h00000FFF& ' 0X0FFF Reserved
CONST VT_VECTOR = &h00001000& ' 0X1000 Simple counted array
CONST VT_ARRAY = &h00002000& ' 0X2000 SAFEARRAY pointer
CONST VT_BYREF = &h00004000& ' 0X4000 Void pointer for local use
CONST VT_RESERVED = &h00008000& ' 0X8000 Reserved
CONST VT_ILLEGAL = &h0000FFFF& ' 0XFFFF Illegal value
CONST VT_ILLEGALMASKED = &h00000FFF& ' 0X0FFF Illegal masked value
CONST VT_TYPEMASK = &h00000FFF& ' 0X0FFF Type mask
我相信它们与来自 win32
的 VARENUM 枚举 (wtypes.h) 一致
https://docs.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-varenum
这将使他们成为以下人。
15 - VT_I1 - 一个字符。
16 - VT_UI1 - 无符号字符。
对于 VBScript,“VarType(x)”函数 return 的值为 0-14、17 和 8192,其中每个值代表“x”参数的变量类型。在那个序列中,有明显的缺失值 15 和 16.
缺失值 15 和 16 代表什么类型?我需要追溯到多远的历史或多深的 VBScript 内部才能找到答案?
- 编辑 2021 年 4 月 30 日
这是我想出的扩展类型编号列表,超出了“VarType”和“TypeName”的功能 return:
CONST VT_EMPTY = &h00000000& ' 0X0000 Not specified
CONST VT_NULL = &h00000001& ' 0X0001 Null
CONST VT_I2 = &h00000002& ' 0X0002 A 2-byte integer
CONST VT_I4 = &h00000003& ' 0X0003 4-byte integer
CONST VT_R4 = &h00000004& ' 0X0004 4-byte real
CONST VT_R8 = &h00000005& ' 0X0005 8-byte real
CONST VT_CY = &h00000006& ' 0X0006 Currency
CONST VT_DATE = &h00000007& ' 0X0007 Date
CONST VT_BSTR = &h00000008& ' 0X0008 String
CONST VT_DISPATCH = &h00000009& ' 0X0009 IDispatch pointer
CONST VT_ERROR = &h0000000A& ' 0X000A SCODE value
CONST VT_BOOL = &h0000000B& ' 0X000B Boolean value; True is -1 and false is 0
CONST VT_VARIANT = &h0000000C& ' 0X000C Variant pointer
CONST VT_UNKNOWN = &h0000000D& ' 0X000D IUnknown pointer
CONST VT_DECIMAL = &h0000000E& ' 0X000E 16-byte fixed-pointer value
CONST VT_I1 = &h00000010& ' 0X0010 Character
CONST VT_UI1 = &h00000011& ' 0X0011 Unsigned character
CONST VT_UI2 = &h00000012& ' 0X0012 Unsigned short
CONST VT_UI4 = &h00000013& ' 0X0013 Unsigned long
CONST VT_I8 = &h00000014& ' 0X0014 64-bit integer
CONST VT_UI8 = &h00000015& ' 0X0015 64-bit unsigned integer
CONST VT_INT = &h00000016& ' 0X0016 Integer
CONST VT_UINT = &h00000017& ' 0X0017 Unsigned integer
CONST VT_VOID = &h00000018& ' 0X0018 C-style void
CONST VT_HRESULT = &h00000019& ' 0X0019 HRESULT value
CONST VT_PTR = &h0000001A& ' 0X001A Pointer type
CONST VT_SAFEARRAY = &h0000001B& ' 0X001B Safe array; Use VT_ARRAY in VARIANT
CONST VT_CARRAY = &h0000001C& ' 0X001C C-style array
CONST VT_USERDEFINED = &h0000001D& ' 0X001D User-defined type
CONST VT_LPSTR = &h0000001E& ' 0X001E Null-terminated string
CONST VT_LPWSTR = &h0000001F& ' 0X001F Wide null-terminated string
' 0x0020 - 0x0023
CONST VT_RECORD = &h00000024& ' 0X0024 User-defined type
CONST VT_INT_PTR = &h00000025& ' 0X0025 Signed machine register size width
CONST VT_UINT_PTR = &h00000026& ' 0X0026 Unsigned machine register size width
' 0x27 - 0x3F
CONST VT_FILETIME = &h00000040& ' 0X0040 FILETIME value
CONST VT_BLOB = &h00000041& ' 0X0041 Length-prefixed bytes
CONST VT_STREAM = &h00000042& ' 0X0042 The name of the stream follows
CONST VT_STORAGE = &h00000043& ' 0X0043 The name of the storage follows
CONST VT_STREAMED_OBJECT = &h00000044& ' 0X0044 The stream contains an object
CONST VT_STORED_OBJECT = &h00000045& ' 0X0045 The storage contains an object
CONST VT_BLOB_OBJECT = &h00000046& ' 0X0046 The blob contains an object
CONST VT_CF = &h00000047& ' 0X0047 Clipboard format
CONST VT_CLSID = &h00000048& ' 0X0048 Class ID
CONST VT_VERSIONED_STREAM = &h00000049& ' 0X0049 Stream with a GUID version
CONST VT_BSTR_BLOB = &h00000FFF& ' 0X0FFF Reserved
CONST VT_VECTOR = &h00001000& ' 0X1000 Simple counted array
CONST VT_ARRAY = &h00002000& ' 0X2000 SAFEARRAY pointer
CONST VT_BYREF = &h00004000& ' 0X4000 Void pointer for local use
CONST VT_RESERVED = &h00008000& ' 0X8000 Reserved
CONST VT_ILLEGAL = &h0000FFFF& ' 0XFFFF Illegal value
CONST VT_ILLEGALMASKED = &h00000FFF& ' 0X0FFF Illegal masked value
CONST VT_TYPEMASK = &h00000FFF& ' 0X0FFF Type mask
我相信它们与来自 win32
的 VARENUM 枚举 (wtypes.h) 一致https://docs.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-varenum
这将使他们成为以下人。
15 - VT_I1 - 一个字符。
16 - VT_UI1 - 无符号字符。