是否有 VBScript Array 类型类或类似的东西,我可以在其中的两个项目之间添加项目?一旦添加,其现有项目应转移到管理位置。我正在寻找的功能可用于ArrayList or Dictionary objects
从方法之间(如果有)!
谢谢
真是一个惊喜:ArrayList.Insert
演示版 2.0:
Option Explicit
Dim alA : Set alA = CreateObject("System.Collections.ArrayList")
Dim alB : Set alB = CreateObject("System.Collections.ArrayList")
alA.Add "A"
alA.Add "C"
alA.Insert 1, "B"
alB.Add "one"
alB.Add "two"
WScript.Echo "alA: ", Join(AlA.ToArray())
alA.InsertRange 1, (alB) ' Call By Value () needed!
WScript.Echo "alA: ", Join(AlA.ToArray())
输出:
alA: A B C
alA: A one two B C