>_Screen.AddObject("tool","_tool") >?_screen.tool.Run() >CLEAR ALL >?_screen.tool.Run() && where is my tool? > >define CLASS _tool AS custom > name="_tool" > > PROCEDURE Run() > wait wind "tool..." > ENDPROC >enddefine >>
clear ON ERROR && RETURN TO TOPLEVEL SET NULLDISPLAY TO "None" =CREATEOBJECT("replicator") =ADDPROPERTY(_screen.replicator,"anotherproperty","someValue") ? "object is ",_screen.replicator.TAG ? "anotherproperty is ",_screen.replicator.anotherproperty ? "counter is ",_screen.replicator.counter * this is stopped TOPLEVEL() ? "object is ",_screen.replicator.TAG ? "anotherproperty is ",_screen.replicator.anotherproperty ? "counter is ",_screen.replicator.counter * this is not stopped TOPLEVEL() ? "object is ",_screen.replicator PROCEDURE TOPLEVEL CLEARALL() PROCEDURE CLEARALL ? ? "clear all" CLEAR ALL ENDPROC define CLASS replicator AS custom counter = 2 PROCEDURE Init this.Tag = SYS(2015) _Screen.AddPROPERTY("replicator",m.This) ? "init",THIS.TAG PROCEDURE Error LPARAMETERS nError, cMethod, nLine RETURN TO TOPLEVEL PROCEDURE DESTROY ? "DESTROY",THIS.TAG THIS.counter=THIS.counter-1 IF THIS.counter=1 WITH CREATEOBJECT(m.This.Class) FOR I=1 TO AMEMBERS(APROPERTY,m.This,0) IF TYPE("this."+APROPERTY[m.i])=="U" OR PEMSTATUS(m.this,APROPERTY[m.i],1) LOOP ENDIF =.ADDPROPERTY(APROPERTY[m.i],GETPEM(m.This,APROPERTY[m.i])) NEXT * for ... to aevents().... * ENDWITH THROW ENDIF ENDDEFINE