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

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lars
User
User
Posts: 31
Joined: Sat Sep 27, 2003 5:54 pm
Location: Bonn, Germany
Contact:

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

Post 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
Lars
User
User
Posts: 31
Joined: Sat Sep 27, 2003 5:54 pm
Location: Bonn, Germany
Contact:

Post by Lars »

Why no replies?
Is the Thema not interessting or is my request too much?
Lars
The only problem with troubleshooting is that sometimes the trouble shoots back.
P4 3Ghz, 512MB RAM, Radeon 9600Pro, WinXP Home SP2, PB V4.0
LarsG
Enthusiast
Enthusiast
Posts: 713
Joined: Mon Jun 02, 2003 1:06 pm
Location: Norway
Contact:

Post by LarsG »

Maybe this link will help you..

viewtopic.php?t=7174&highlight=linkedlist

-Lars

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Lars
User
User
Posts: 31
Joined: Sat Sep 27, 2003 5:54 pm
Location: Bonn, Germany
Contact:

Post 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.
Fred
Administrator
Administrator
Posts: 18441
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post 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..
Lars
User
User
Posts: 31
Joined: Sat Sep 27, 2003 5:54 pm
Location: Bonn, Germany
Contact:

Post by Lars »

It is a pity. . .
Would it be possible then that you (fred) integrate a SwapLLElements()-Function in PB?
Lars
The only problem with troubleshooting is that sometimes the trouble shoots back.
P4 3Ghz, 512MB RAM, Radeon 9600Pro, WinXP Home SP2, PB V4.0
Fred
Administrator
Administrator
Posts: 18441
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Sure, SwapElements() could be a nice addition. I will looking forward to a such function.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1396
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
Lars
User
User
Posts: 31
Joined: Sat Sep 27, 2003 5:54 pm
Location: Bonn, Germany
Contact:

Post 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.
Lars
The only problem with troubleshooting is that sometimes the trouble shoots back.
P4 3Ghz, 512MB RAM, Radeon 9600Pro, WinXP Home SP2, PB V4.0
Post Reply