Nested Linked Lists
Posted: Fri Jul 04, 2003 2:30 pm
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()
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()