Delete type - best method?

BlitzMax Forums/BlitzMax Beginners Area/Delete type - best method?

coffeedotbean(Posted 2005) [#1]
I just some some advice on the best, proper, way to remove a type from a list. Im not using the OOP stuff or the method.. but i will in time, but for this code which is the best way to remove the type, i know of two ways. There are lots of threads on this but i just get confussed.

Setup type list
Global LBoat:TList=New TList
Type TBoat
	Field x#,y#
End Type


Add a type to list
For i=0 To 9
	b:TBoat = New TBoat
	ListAddLast LBoat,b
Next


remove a type from the list(which is best)
ListRemove(LBoat,b) ' 1?
LBoat.remove(b) ' 2?



Rimmsy(Posted 2005) [#2]
ListRemove(LBoat,t) should do it. That's how I've been doing it.


Robert Cummings(Posted 2005) [#3]
They are both the same.


Yan(Posted 2005) [#4]
As fish said, ListRemove() is just a function wrapping the TList.Remove() method. Using the method directly is gonna be ever so slightly faster.