Arrays of Lists Issue

BlitzMax Forums/BlitzMax Beginners Area/Arrays of Lists Issue

Will(Posted 2005) [#1]
I have an array of TLists that I am trying to resize using slices like this:

'This is in a type
Field gamePopulationHistory:TList[]

'This is in the create function
ng.gamePopulationHistory = New TList[0]
ng.addGamePopulationHistory()

'This is in another function called to update the game history
gamePopulationHistory = gamePopulationHistory[0.. gamePopulationHistory.length+1]  'THIS IS LINE 195
gamePopulationHistory[gamePopulationHistory.length] = CreateList()



Here is the compile error:
"Compile Error: Slices can only be used with strings or one dimensional arrays
[/Games Work/Divine Design/Game Type.bmx;195;3]"


Any idea why this isn't working?


Perturbatio(Posted 2005) [#2]
Local gph:TList[]

gph = gph[..1]
Print gph.length
gph[0] = New TList
gph = gph[..gph.length+1]
gph[gph.length-1]=New Tlist
Print gph.length



Will(Posted 2005) [#3]
Thanks, my code worked actually, the issues was that it was in a function and not a method :P