DoDefault(toRecord, "myView") > -----Original Message----- > From: [email protected] [mailto:profoxtech- > [email protected]] On Behalf Of MB Software Solutions, LLC > Sent: Monday, July 05, 2010 7:21 PM > To: [email protected] > Subject: Calling parent classes method with same name (for sake of > consistency in interface) > > VFP9SP1 - Challenge is to have MyChild.AddRecord call MyOriginal's code > besides doing some of MyChild's code around the call. > > DEFINE CLASS MyOriginal as Custom > FUNCTION AddRecord(toRecord as Object, tcView as String) as Integer > * LABEL "CODE A" do code here > ENDFUNC > ENDDEFINE && MyOriginal > > DEFINE CLASS MyChild as MyOriginal > FUNCTION AddRecord(toRecord) as Integer > LOCAL liKey as Integer > * I want to call the code in MyOriginal and do perhaps a few more things > * These don't work: > liKey = this.AddRecord(toRecord,"MyView") && tries to call this function > recursively > liKey = this:AddRecord(toRecord,"MyView") && syntax error > liKey = this.parent.AddRecord(toRecord,"MyView") && parent not > defined > ENDFUNC > > ENDDEFINE > > > I could have swore I've done this before but seem to be having a brain fart at > the moment. I've successfully done this when the function in MyChild is > named differently. I'm thinking that I've tried this before, but VFP doesn't > allow this kind of thing due to its type of inheritence. > Can someone show me what I'm forgetting? Specifically, I want to tell > MyChild to call MyOriginal's function and have the same name for interface- > sake. > > Thanks in advance! > > -- > Mike Babcock, MCP > MB Software Solutions, LLC > President, Chief Software Architect > http://mbsoftwaresolutions.com > http://fabmate.com > http://twitter.com/mbabcock16 > [excessive quoting removed by server]
_______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

