
Handling LISTs and QUEUEs in VB.NET
Quote:
> Hi Everyone,
> Nowadays I am trying to implement a MM1 queue in VB.NET.
> So the problem which I am facing right now is that can we
> implement a LIST or a QUEUE in VB.NET. Or is there any
> LIST or QUEUE class in VB.NET. I know that there is a
> QUEUE class but if we create an object of this class, the
> object takes only one value whereas I want to put two
> values in one variable (something like a structures
> consisting of two variables and a pointer to itself)
> Thanks
> Faisal Iradat
I'm not sure I understand your last comment... If you have a group of
values you want to place in a queue, just create a class and put that in the
queue?
Class Data
public sub new()
end sub
Public Sub New (i As Integer, s As String)
me.i = i
me.s = s
End Sub
Public i As Integer
Public s As String
End Class
Dim q As New Queue()
q.enqueue(new Data(10, "Hi"))
q.enqueue(new Data(5, "Bye"))
...
dim d as data = ctype(q.dequeue(), Data)
....
If this isn't what you want, maybe you could explain in a little more
detail, maybe provide some sample code...
Tom Shelton