VBScript to perform Queue operations
kw.vbs
Set Queue = CreateObject("System.Collections.Queue") 
Queue.Enqueue "Apple"
Queue.Enqueue "Banana"
Queue.Enqueue "Cherry"
Queue.Enqueue "Durian"

For Each item In Queue
    q = q & item & " "
Next
print q
print "Count " & Queue.Count
print Queue.Contains("Apple") & vbCrLf 
print "Dequeue " & Queue.Dequeue & vbCrLf
print "Peek " & Queue.Peek & vbCrLf 
print Join(Queue.ToArray, ", ") & vbCrLf 
Output
Apple Banana Cherry Durian 
Count 4
True
Dequeue Apple
Peek Banana
Banana, Cherry, Durian
Advertisement