Using Int is the old way of doing it. BMax will create an object handle to the type. Unfortunately, your program could create a memory leak if the handle isn't properly released. When you use TGadget instead, the garbage collector will take care of freeing the objects for you.
Local a:Int
For a = EachIn MyTypeList
Print a.name
Release a '<-- without this, you would have a memory leak
Next
'-----------------------
Local a:MyType
For a = EachIn MyTypeList
Print a.name 'no need to release, the GC will take care of that
Next
If you use Strict or Superstrict at the top of your code, which you should be doing, will disallow the use of object handles.
|