On Thursday 26 February 2009 11:38:38 Kleyber Derick wrote: > Hi all, > > My name is Kleyber and this is my first post here. I am considering to > migrate from xHarbour to Harbour, and I would like to know if it's possible > to have these three commands: > > OVERRIDE METHOD <MethodName> ; > IN CLASS <ClassName> WITH <FunctionName> > > EXTEND CLASS <ClassName> WITH DATA <MemberName> [ PERSISTENT ] > > EXTEND CLASS <ClassName> WITH ; > [ MESSAGE <MessageName>] METHOD <FunctionName> > > That exists in xHarbour and are useful to me. Can you considerate this? Or > there is other commands in Harbour which do the same thing?
Hello Kleyber, I had exactly the same need time ago when I migrate some apps from xHarbour to Harbour (about 2 years ago). In fact, recently a thread in this NG dealed with this regard: [Start Message Referenced] Re: [Harbour] TGet: setting cursor position to ::nMaxLen + 1 From: Przemyslaw Czerpak <dru...@acn.waw.pl> To: "Harbour Project Main Developer List." <harbour@harbour-project.org> Date: 2009-02-20 05:22 On Fri, 20 Feb 2009, Enrico Maria Giordano wrote: Hi, >> You can subclass the GET() class and create your custom setPosMy() method, >> or maybe you can even override the original and continue to use the name. > Can I add my own method to a class without touching the class itself? If > yes, how? Harbour has a feature which can block class modification so such action can be forbidden by programmer. Anyhow if class is not locked (core classes isn't) then it's possible. But you have to be careful because it's possible to create some really strange results, f.e. when you add some new methods to the class from which some other classes inherited before and then in object of this classes you will use super casting. __clsAddMsg( <hClass>, <cMessage>, <sMthFunction> | <bMthBlock>, <nType>, ; [xInit], <uiScope> ) f.e.: __clsAddMsg( getNew():hClass, "MYMSG", @myMethod(), HB_OO_MSG_METHOD,, ; HB_OO_CLSTP_EXPORTED ) best regards, Przemek [End Message Referenced] > > Best regards > > Kleyber Derick best regards, Teo _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour