Linked List

Everything else that doesn't fall into one of the other PB categories.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Linked List

Post by Polo »

This may have been asked before, but I would like to store a Linked list in another one, in the aim of being able to use the first one without having mylist(). Err, pseudo code would be easier to understand :

Newlist indexlist()

Newlist myfirstlist()
Newlist mysecondlist()
Newlist mythirdlist()

addelement(indexlist()
indexlist()=myfirstlist()

addelement(indexlist()
indexlist()=mysecondlist()

addelement(indexlist()
indexlist()=mythirdlist()

thethirdlist=selectelement(indexlist(),3)

addelement(thethirdlist)
[...]

the problem is that this code doesnt work, we need to use the original mythirdlist() to add an element to it :(
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply