devxlogo

D

You can use the technique for an “undo” menu/toolbar option. Use a collection instead of a listbox to reduce overhead. Support for both LIFO and FIFO is also included:

 Public Queue As New CollectionPublic Const Q_LIFO = 0Public Const Q_FIFO = 1 Public Sub Enqueue(QueueItem As Variant)	Queue.Add QueueItemEnd Sub Public Function Dequeue(Optional Mode As Long) As Variant 	Dim Position as Long 	If Queue.Count > 0 Then		If Mode = Q_LIFO Then 			Position = Queue.Count		Else			Position = 1 		End If 		Dequeue = Queue(Position)		Queue.Remove Position	Else		Dequeue = Null	End IfEnd Function 

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  How Seasoned Architects Evaluate New Tech

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.