• Welcome to Valhalla Legends Archive.
 

Addin Query's

Started by Fr0z3N, May 19, 2003, 09:22 AM

Previous topic - Next topic

Fr0z3N

Does anyone have a simple AddQuery Code that I would be able to use?

Tuberload

My suggestion would be to go look it up, try to figure out how it works, and then you will have learned something. After you have done all of that you will have an idea of what's going on and if you are still stuck you can elaborate with people on the subject, not just ask for free information.

BTW, this was not meant as a flame/insult/etc...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

TheMinistered

#2
I assume you are referring to a Queue which is the exact opposite of a Stack.   Stack is LIFO (Last In First Out) and Queue is FIFO (First In First Out)

CQueue

Dim Queue As Collection

Public Sub Class_Initialize()
   Set Queue = new Collection
End Sub

Public Sub Enqueue(ByVal value As Variant)
   Queue .Add value
End Sub

Public Function Dequeue() As Variant
   Dequeue = Queue .Item(1)
   Queue .Remove 1
End Function

Public Function Peek() As Variant
   Peek = Queue .Item(1)
End Function

Public Function Count() As Long
   Count = Queue .Count
End Function

Public Sub Clear()
   Set Queue = New Collection
End Sub

Public Sub Class_Terminate()
   Set Queue = Nothing
End Sub

Enjoy!

Fr0z3N

Ok I'll try that im in PEi right now ^.^