Demo of the Stack Class
This is at the head of the queue.

Outputting the queue contents:
This
is
a
test!


The above demo was generated using the following code:

<% Option Explicit %>
<!--#include file="Queue.Class.asp"-->
<%
  Dim objQueue
  Set objQueue = new Queue

  'Push some data on the stack
  objQueue.Enqueue("This ")
  objQueue.Enqueue("is ")
  objQueue.Enqueue("a ")
  objQueue.Enqueue("test! ")

  'What is on the top?
  Response.Write objQueue.Peek() & " is at the head of the queue.<P>"

  'Remove all the data displaying it
  Response.Write "<B>Outputting the queue contents:</B><BR>"

  While objQueue.Count > 0
    Response.Write objQueue.Dequeue() & "<BR>"
  Wend

  set objQueue = nothing
%>


  • [Read the article]
  • [Download the source to WeakList.Class.asp in text format]
  • [Download the source to Queue.Class.asp in text format]