AddList / removeList

BlitzMax Forums/BlitzMax Beginners Area/AddList / removeList

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

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