AddList / removeList

BlitzMax Forums/BlitzMax Beginners Area/AddList / removeList

but it works :D
SeedRnd(MilliSecs())

Type TBall

	Field radius%

End Type

Global playerball:Tball
playerball = New TBall
playerball.radius = Rand(0, 100)
Print playerball.radius

Global balllist:Tlist = CreateList()
For Local i = 0 To 100

	Local aball:Tball = New TBall
	aball.radius = Rand(0, 100)
	balllist.addlast(aball)

Next

myfunc()

Function myfunc()

	Local tmpBall:TBall = playerball
	Print tmpball.radius
	
	Print tball(balllist.first()).radius
	playerball = tball(balllist.first())
	Print playerball.radius + " - V - " + tmpball.radius
	balllist.removefirst()
	Print tball(balllist.first()).radius
	Print playerball.radius + " - V - " + tmpball.radius
	
	balllist.addfirst(tmpball)
	Print tball(balllist.first()).radius

End Function


edit: oh, ok np