|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to implement Link List in VB 6.0?Dear All,
Can anyone help me out in implementing Link List in VB 6.0 ? Thanks in advance Peri "Peri" <p***@CSPL.com> wrote: You mean something like:> Can anyone help me out in implementing Link List in VB 6.0 ? Private Type tStruct sName As String iID As Long iPrevious As Long iNext As Long End Type Private aItems() As tStruct Public Sub main() Dim i As Long ReDim aItems(10) For i = 1 to 10 With aItems(i - 1) .Name = CStr(i) .ID = i - 1 .Previous = i - 2 .Next = i End With Next i End Sub Hope this helps. Jim Carlock Post replies to the group. On Mon, 20 Mar 2006 10:57:10 +0530, "Peri" <p***@CSPL.com> wrote: Do you /really/ want to use a Linked List>Dear All, > >Can anyone help me out in implementing Link List in VB 6.0 ? - or is this a homework assignment For real code Linked Lists are a PITA Peri wrote:
> Dear All, Class SomeObject> > Can anyone help me out in implementing Link List in VB 6.0 ? > > Thanks in advance > > Peri Public Data as Double Public PrevPtr as SomeObject Public NextPtr as SomeObject Public Sub LinkThis(NewLink as SomeObject) Set Me.NextPtr = NewLink Set NewLink.PrevPtr = Me End Sub End Class Module modMain Sub Main() Dim Temp as SomeObject Dim Head as SomeObject Set Temp = New SomeObject Set Head = Temp Temp.Data = 1.1 Temp.LinkThis New SomeObject Set Temp = Temp.NextPtr Temp.Data = 2.2 Temp.LinkThis New SomeObject Set Temp = Temp.NextPtr Temp.Data = 3.3 Set Temp = Head Do Until Temp is Nothing MsgBox Temp.Data Set Temp = Temp.NextPtr Loop End Sub End Module
Are there alternatives to using WIN32_Find_Data?
SendMessage vs. PostMessage Best ways for reading and editing text files keycodes Timer to start my program at a certain time? OT: Blew away shortcut to desktop, How to replace it?? Windows 2000 Professional search for a file using vba Question about Strings to Numbers VB Newbie Error Message |
|||||||||||||||||||||||