JJ
2018-04-26 19:16:12 UTC
In MSDN's "VarType()" document, it states:
"For example, the value returned for an array of integers is calculated as 2
+ 8192, or 8194."
However, the value is 8204 instead of 8194, when I test it using below code.
dim a(0)
a(0) = 1
wscript.echo vartype(a) 'shows 8204
8204 in hexadecimal is 0x200C, which is a combination of vbArray and
vbVariant. Meaning that it's an array of variants, instead of an array of
integer. So, which one is correct?
To add into the confusion, the contents of the array doesn't really matter.
i.e.
dim a(0)
a(0) = true
wscript.echo vartype(a) 'still shows 8204
a(0) = "abc"
wscript.echo vartype(a) 'still shows 8204
dim b(0)
a(0) = b
wscript.echo vartype(a) 'still shows 8204
Also, for research purpose, there are two types that I'm unable to produce:
vbError and vbDataObject. For vbError, I immediately thought of the Error
object. But its type is actually vbObject. So, what class/component produces
such types?
"For example, the value returned for an array of integers is calculated as 2
+ 8192, or 8194."
However, the value is 8204 instead of 8194, when I test it using below code.
dim a(0)
a(0) = 1
wscript.echo vartype(a) 'shows 8204
8204 in hexadecimal is 0x200C, which is a combination of vbArray and
vbVariant. Meaning that it's an array of variants, instead of an array of
integer. So, which one is correct?
To add into the confusion, the contents of the array doesn't really matter.
i.e.
dim a(0)
a(0) = true
wscript.echo vartype(a) 'still shows 8204
a(0) = "abc"
wscript.echo vartype(a) 'still shows 8204
dim b(0)
a(0) = b
wscript.echo vartype(a) 'still shows 8204
Also, for research purpose, there are two types that I'm unable to produce:
vbError and vbDataObject. For vbError, I immediately thought of the Error
object. But its type is actually vbObject. So, what class/component produces
such types?