>oForm = CreateObject('myForm') >oForm.OverloadObject('atextbox','datetextbox','') >oForm.Show(1) > >Define Class myForm as Form > Add Object atextbox as textbox > > Procedure OverloadObject(cName,cClass,cClassLib) > form::Removeobject(m.cName) > form::Newobject(m.cName,m.cClass,evl(m.cClassLib,'')) > EndProc >EndDefine > >Define Class datetextbox as textbox > Format = 'D' >EndDefine >>I get the error "Objectname is invalid" at the line form::Newobject. What did I misunderstood?
clear oForm = CreateObject('myForm') oForm.OverloadObject('atextbox',"editbox",'') Define Class myForm as Form Add Object atextbox as textbox Procedure OverloadObject(cName,cClass,cClassLib) form::Removeobject(m.cName) * none members ? "COMPONENTS :",m.this.controlcount,AMEMBERS(ao,m.this,2) * bug ? m.cName," IS ",GETPEM(m.this,m.cName) WITH GETPEM(m.this,m.cName) && this is a Zombi object .baseclass ENDWITH form::Newobject(m.cName,m.cClass,m.cClassLib) ? "is cName a empty object ?", ADDPROPERTY(GETPEM(m.this,m.cName),"baseclass","empty") ? "don't believe in what I tell you, because if you verify it" WITH GETPEM(m.this,m.cName) .baseclass ENDWITH ? "have proerties ? count it :",AMEMBERS(ao,GETPEM(m.this,m.cName)) ENDPROC PROCEDURE Error LPARAMETERS nError, cMethod, nLine ? " line : ",MESSAGE(1)," Error : ",MESSAGE() ENDDEFINE