VBScript IsArray 函数

IsArray 函数返回一个布尔值,指示指定的输入变量是否为数组变量。

语法

IsArray(variablename)

示例

<!DOCTYPE html>
<html>
   <body>
      <script language = "vbscript" type = "text/vbscript">
         a = array("Red","Blue","Yellow")
         b = "12345"

         Document.write("The IsArray result 1 : " & IsArray(a) & "<br />")
         Document.write("The IsArray result 2 : " & IsArray(b) & "<br />")

      </script>
   </body>
</html>

当上述代码保存为 .HTML 并在 Internet Explorer 中执行时,会产生以下结果−

The IsArray result 1 : True
The IsArray result 2 : False

vbscript_arrays.html