Test this one:
Type BaseObject Global list:TList Global IDCount Field ID Field Link:TLink Function Get_Object:BaseObject(_ID) Local o:baseobject For o = EachIn List If o.ID = _ID Then Return o End If Next Return Null End Function Method New() If List = Null Then List = CreateList() Link=list.Addlast(Self) IDCount :+ 1 ID = IDcount Print("BaseObj::New()") End Method Method Get_ID:Int() Return ID End Method Method Remove() Link.Remove() If CountList(List) = 0 Then List=Null;Print "List is Emty!" Flushmem() End Method End Type Type Testtype Extends BaseObject Field A Field B Method New() Print("Testype::New()") End Method Method Delete() Print("Testype::Delete()") End Method '--------e--------------- Function Create_Test() Local Test:Testtype test = New testtype Return test.ID End Function End Type Local A:testtype = New testtype Notify A.Get_ID() Local B:testtype = New testtype Notify B.Get_ID() A.Remove() B.Remove() B = Null A = Null FlushMem FlushMem End