'建立队列
Dim Que : Set Que = CreateObject("System.Collections.Queue")
Que.EnQueue("Element1")
Que.EnQueue("Element2")
Que.EnQueue("Element3")
'查看队列中的元素数
WScript.Echo "队列中的元素数: " Que.Count
WScript.Echo
'遍历队列
Sub TraverseQue
Dim ArrQue : ArrQue = Que.ToArray
Dim Counter
For Counter = 0 To UBound(ArrQue)
WScript.Echo ArrQue(Counter)
Next
End Sub
TraverseQue
WScript.Echo
'退出队列
WScript.Echo Que.DeQueue
WScript.Echo "---"
TraverseQue
WScript.Echo
'清空队列
Que.Clear
WScript.Echo "队列中的元素数: " Que.Count