Page 1 of 1

Nested Linked Lists

Posted: Fri Jul 04, 2003 2:30 pm
by Justin
There was some work about this at the forum but i founded a little confusing so i did these functions.

They are done to have linked lists inside linked lists. Basically i coded a double linked list with the same commands as the PB lists and *almost* the same behaviour. The difference is that this lists are handled through its pointer, so you can create lists dinamically and have nested lists because you can store the pointer to a list inside an element of a list.

The idea is to use a PB list for the main list and use the functions for the nested list.

I spent some time writing examples and explaining the functions, it's here, you need to paste the link into a d/L manager os use save target as on the link:

http://www.angelfire.lycos.com/alt2/jus ... ist1.0.zip

The code is very portable, it does not use structures, all the memory is handled by peek/poke and using globalalloc , only for windows.

It's not extensively tested but i think it works well, commands are:

NewListX()
NextElementX()
PreviousElementX()
AddElementX()
InsertElementX()
SelectElementX()
ChangeListPointerX()
ListPointerX()
ListIndexX()
CountListX()
ResetListX()
LastElementX()
FirstElementX()
DeleteElementX()
ClearListX()
FreeListX()
SwitchElementX()

Re: Nested Linked Lists

Posted: Sat Jul 05, 2003 4:40 am
by tinman
Justin wrote:The code is very portable, it does not use structures, all the memory is handled by peek/poke and using globalalloc , only for windows.
You realise you could have saved yourself some time by just looking at the resources site and modifying my code? That's why the source is included...

Posted: Sat Jul 05, 2003 10:50 am
by Justin
I don't like to hack others people code. Probably i would spent more time modifying it that starting from scratch, i think my approach is pretty different than yours.