[Implemented] LinkedLists inside Structures

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
ZeHa
User
User
Posts: 38
Joined: Sun Apr 24, 2005 11:39 pm

[Implemented] LinkedLists inside Structures

Post by ZeHa »

Hello,

I think it would be essential to be able to do something like this:

Code: Select all

Structure Player 
    xPos.l 
    yPos.l 
    NewList weapons.Weapon()       ; <-- look here :)
EndStructure
There are a few workarounds like creating your own lists and so on, but I think this should be a native feature of PB.

Would this be possible for 4.2 or 4.3? :)
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: LinkedLists inside Structures

Post by Kiffi »

A good idea! I second this! :D

Greetings ... Kiffi
Hygge
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Would be veeery handy :D
Windows 7 & PureBasic 4.4
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

Nice and powerful addition.

+1
Dare2 cut down to size
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

+1

That would be nice!

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

yeah :D , would spare me my barely working amateur tree list stuff 8)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

+1 :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Hurga
Enthusiast
Enthusiast
Posts: 148
Joined: Thu Jul 17, 2003 2:53 pm
Contact:

Post by Hurga »

I agree

+1
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

+1 8)
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

++
bye,
Daniel
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

I disagree.
A dynamic linkedlist lib would be more important.

Code: Select all

Structure tProps
   sName.s
   sAssoc.s
EndStructure

Structure tMyData
   sName.s
   sEmail.s
   *Properties.tProps
EndStructure

*List.tMyData = NewList
AddElement (*List)
*List\sName = "Frédéric Laboureur"
*List\sEmail = "support [at] purebasic.com"
; With dynamic instanced LinkedList, you could do that.
*List\Properties = NewList
AddElement (*List\Properties)
*List\Properties\sName = "talent"
*List\Properties\sAssoc = "Developed a realy cool programming language."
Best regards

Wolf
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

Why not both?
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

LinkedList in structures would make necessary to change the syntax of purebasic.
That could be a new source of bugs. *paranoia*

Best regards

Wolf
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

-6
ZeHa
User
User
Posts: 38
Joined: Sun Apr 24, 2005 11:39 pm

Post by ZeHa »

@ Hroudtwolf: Why would the syntax change?!

I think it's totally important to have this. Otherwise, you can only have global lists and not bind them to an object. What do you do when you want to have a linked list for every new object you create? Let's say you've got a structure for a "person", and the person should be able to carry an arbitrary amount of stuff in his pockets. How would you do that? You can only use fixed-length arrays inside a structure.
Post Reply