I saw that I can modify a method of a class directly with the OVERRIDE command without having to modify the class.
Can I add Data or new methods with the same technique? and how ?
Antonio Linares wrote:Dear Silvio,
Please review this:
https://github.com/harbour/core/blob/master/src/rtl/objfunc.prg
#xcommand OVERRIDE METHOD <!Message!> [IN] CLASS <!Class!> ;
WITH [METHOD] <!Method!> [SCOPE <Scope>] => ;
__clsModMsg( <Class>():classH, #<Message>, @<Method>() )
OVERRIDE METHOD BuildButtonBar IN CLASS TPreview WITH PreviewBuildButtonBar
Antonio Linares wrote:FUNCTION __objAddData( oObject, cSymbol )
it is inside:
https://github.com/harbour/core/blob/master/src/rtl/objfunc.prg
Antonio Linares wrote:Dear Silvio,
You add a new DATA to the object, not to the class:
#xcommand EXTEND DATA <!Message!> [IN] OBJECT <!object!> => ;
__objAddData( <object>, #<Message> )
function Main()
local oError := ErrorNew()
__objAddData( oError, "test" )
oError:test = "hello"
? oError:test
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 29 guests