put the list in the type

BlitzMax Forums/BlitzMax Beginners Area/put the list in the type

Well whether your list is global or a field depends what it's a list of. If you're trying to emulate B3D's list of all objects of that type then having it global is the correct way. From the question, I'm not entirely sure which it is you're after.


I'm also not sure if you're expecting Create to be called automatically, but just to point out that it won't be. The only thing which is called automatically is the New() method. So either put it there or have it automatically create upon initialization of the type, eg:

Global List:TList=New TList


Or if you want a list in each object, as in GFK's reply

Field List:TList=New TList