Why does VarType() ALWAYS return 8204 for Arrays

前端 未结 3 1308
北恋
北恋 2021-01-12 00:54

In the VarType MSDN Microsoft documentation for VBScript\'s VarType function it says (With bold emphasis):

\"Remarks The VarType function

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-12 01:35

    From documentation

    In VBScript, variables are always of one fundamental data type, Variant.

    Data contained in the variable can be of any type, but variables itself are always of Variant type. Checking with VarType the contents of a position of an array will return the type of data contained. But the array itself is a compound of "cells" of Variant type

    So, in your case VarType will return vbArray (8192) + vbVariant (12) = 8204

提交回复
热议问题