Some more LinkedList Features

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Some more LinkedList Features

Post by Tranquil »

As maybe often requested I would like to have a possibillity to create dynamicly lists (without the use of user tips and tricks codes) and maybe an option for internaly indexed elements. Maybe something like:

NewIndexedList ListName.Struct()

so that SelectElement() does not need to jump through all elements.

Some ppl will now say "Use Arrays for that" but thats not the same. I only like the use of arrays if I know the maximum of elements to store, thats often not possible.
Tranquil
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Use ChangeCurrentElement(). SelectElement is never needed, it's a convenience function.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Uh never saw this command, when was it introduced? :shock: This is indeed nice! You are right, that makes SelectElement() nearly useless.
Tranquil
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

What you ask is a good request, imho. ChangeCurrentElement() goes by pointer and isn't based on content or index, so while it's fast it isn't as usable as your indexing idea would be.
BERESHEIT
Post Reply