typeList.last() not working after a Release?

BlitzMax Forums/BlitzMax Beginners Area/typeList.last() not working after a Release?

Idiot(Posted 2005) [#1]
Maybe someone can tell me what I'm doing wrong :(

Type what
	Field huh
End Type

Global whatList:TList = CreateList()

For x=0 To 99
	w:what = New what
	w.huh = Rand(0,100)
	ListAddLast whatList, w
Next 'x

w:what = what(whatList.last())
Print w.huh
Release w

FlushMem

w:what = what(whatList.last())
Print w.huh



skidracer(Posted 2005) [#2]
That doesn't even compile with latest version of BlitzMax as Release is just for decrementing the reference count of an object when using integer handles (w is a proper object reference so w=null is correct way of decrementing the object's count).

However either way the object is still referenced by the list, you need to remove it from the list using:

whatlist.Remove w



Idiot(Posted 2005) [#3]
Thanks, I was not understanding how to get rid of a type since Delete was removed.