Page 1 of 1

Just info about a few PB-Private-Vars (LLs)

Posted: Sat Sep 27, 2003 6:13 pm
by Lars
Was it possible that the programmer gets access to the private PureBasic Vars which describes the current Linked List element, the first LL element and the last LL element (if they exist, but I think so 8) )?
I need this, because I want to swap two LL elements by their pointers. If I swap the first element by Pointer, I get a problem, because PB gets a wrong element as the first/last.
Please help!

THX a lot!
Lars

Posted: Fri Oct 03, 2003 10:39 am
by Lars
Why no replies?
Is the Thema not interessting or is my request too much?

Posted: Fri Oct 03, 2003 10:58 am
by LarsG
Maybe this link will help you..

viewtopic.php?t=7174&highlight=linkedlist

-Lars

Posted: Fri Oct 03, 2003 3:22 pm
by Lars
It does, THX.
BUT: It would be nice to get access to the PB-FirstElement/PreviousEmelent-Vars anyway. The way above is not the
way i was looking for. Usualy it should be possible to swap two
LL-Elements by just swap their pointer. But THX a lot for your link.

-Lars :wink:

PS: Another workaround: before swapping the pointer add one element at
the start and the end of the list and remove the elements after the
swapping. But this is not as fast as the way from the link.

Posted: Fri Oct 03, 2003 3:59 pm
by Fred
The problem is you want to bash with the internal structure of PB objects which could be subjects to change in future release and invalidate all your code..

Posted: Fri Oct 03, 2003 4:08 pm
by Lars
It is a pity. . .
Would it be possible then that you (fred) integrate a SwapLLElements()-Function in PB?

Posted: Fri Oct 03, 2003 5:16 pm
by Fred
Sure, SwapElements() could be a nice addition. I will looking forward to a such function.

Posted: Fri Oct 03, 2003 5:36 pm
by GPI
Fred wrote:Sure, SwapElements() could be a nice addition. I will looking forward to a such function.
In Germany i would say "Wink mit den Zaunpfahl":

http://www.robsite.de/php/pureboard/vie ... php?t=2396

GPI

Edit: The routines only have problem with the first and last element and when the first parameter is after the second.

Posted: Fri Oct 03, 2003 7:23 pm
by Lars
Fred wrote:Sure, SwapElements() could be a nice addition. I will looking forward to a such function.
THX, that would be very nice.