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.htm
廣告
© . All rights reserved.