[Implemented] Linked List Grouping

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Randy
User
User
Posts: 29
Joined: Sat Sep 30, 2006 11:36 pm
Location: Atlanta, Georgia

[Implemented] Linked List Grouping

Post by Randy »

I looked around and haven't found a request like this yet. Maybe I'm looking for it in the wrong way. Just in case, here is what I have in mind:

Code: Select all

Global NewList abc(3)

Procedure AddXtoList(group, x)
  AddElement(abc(group))
  abc(group) = x
EndProcedure

For i = 1 To 10
  AddXToList(Random(3), i)
Next i

OpenConsole()
For i = 1 To 3
  ForEach(abc(i))
    PrintN(Str(abc())
  Next
Next i

r$ = Input()
CloseConsole()
End
Maybe it will be useful to others. I know it would be to me in the situation I have now although I'll be finished before this is even considered. Still, in the future it might be useful to others.

Randy
Maybe it's just a bunch of stuff that happens -- Homer Simpson
gnasen
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 24, 2008 12:21 am

Re: Linked List Grouping

Post by gnasen »

I think that could be realised in the often wished "List in Lists" feature.
As far as I know it may be integrated in one of the next versions, but im not sure.
At the moment there are some very good workarounds here in the forum.
pb 5.11
Post Reply