Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Oct 22, 2002



Application Security Testing: An Integral Part of DevOps


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 Collection
Public Const Q_LIFO = 0
Public Const Q_FIFO = 1 

Public Sub Enqueue(QueueItem As Variant)
	Queue.Add QueueItem
End 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
			Position = 1 
		End If 
		Dequeue = Queue(Position)
		Queue.Remove Position
		Dequeue = Null
	End If
End Function 
Brian Ray
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date