How does one declare an array in VBScript?

前端 未结 2 1113
时光取名叫无心
时光取名叫无心 2021-01-05 15:46

I used this in Excel and it works fine.

dim varScreen (0 to 2) as string
varScreen(0) = \"sample 1\"
varScreen(1) = \"sample 2\"
varScreen(2) = \"sample 3\"
         


        
2条回答
  •  一生所求
    2021-01-05 16:48

    You can also create arrays dynamically using the Array function. Sometimes this is more convenient than assigning array elements separately.

    Dim arr
    arr = Array("sample 1", "sample2", "sample 3")
    

提交回复
热议问题