FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OVERRIDE METHOD
Posts: 47
Joined: Thu Jul 10, 2008 07:33 AM
OVERRIDE METHOD
Posted: Thu Mar 05, 2009 10:43 AM
I'm trying to replace HaldleEvento from TControl:

Code (fw): Select all Collapse
function Main()

   lChDir(cFilePath(HB_ARGV(0)))

   OVERRIDE METHOD HandleEvent IN CLASS TControl WITH ControlHE // <--------------

   SET HELPFILE TO "ayuda1.chm"  
    SetHelpPopup('Ayuda.txt')

   DEFINE WINDOW oWnd FROM 1, 1 TO 40, 120 ;
      MENU BuildMenu()
    oWnd:nHelpID := 'Intro'

   ACTIVATE WINDOW oWnd

return nil

......

static function ControlHE( nMsg, nWParam, nLParam )
   local Self := HB_QSelf()
...


But I'm getting this error:

Code (fw): Select all Collapse
ayuda1.PRG(17) Error E0030  Syntax error "syntax error at 'METHOD'"


Any idea?
Jorge Ignacio Corral
Enjoy it :)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OVERRIDE METHOD
Posted: Thu Mar 05, 2009 11:55 AM

Please include

include "Hbclass.ch"

EMG

Posts: 47
Joined: Thu Jul 10, 2008 07:33 AM
Re: OVERRIDE METHOD
Posted: Thu Mar 05, 2009 04:39 PM
I have it included:

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "InKey.ch"
#include "hbclass.ch"
#include "..\res\resources.h"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   lChDir(cFilePath(HB_ARGV(0)))

    OVERRIDE METHOD HandleEvent IN CLASS TControl WITH ControlHE

   SET HELPFILE TO "ayuda1.chm"  
    SetHelpPopup('Ayuda.txt')

   DEFINE WINDOW oWnd FROM 1, 1 TO 40, 120 ;
      MENU BuildMenu()
    oWnd:nHelpID := 'Intro'

   ACTIVATE WINDOW oWnd

return ni
Jorge Ignacio Corral
Enjoy it :)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OVERRIDE METHOD
Posted: Thu Mar 05, 2009 06:28 PM

Are you using Harbour or xHarbour?

EMG

Posts: 47
Joined: Thu Jul 10, 2008 07:33 AM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 09:51 AM

Harbour 902

Jorge Ignacio Corral
Enjoy it :)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 10:03 AM

Jorge Ignacio,

Harbour does not support OVERRIDE METHOD yet

You need to use xHarbour to have it

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 47
Joined: Thu Jul 10, 2008 07:33 AM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 10:16 AM

Oppss. Thx a lot.

So there is no way to replace a class method with harbour? I have found way to do it with an object but I need to do it with the class on application scope.

Jorge Ignacio Corral
Enjoy it :)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 11:25 AM
This is from Przemek:

Code (fw): Select all Collapse
#xcommand OVERRIDE METHOD <!Message!> [IN] CLASS <!Class!> WITH [METHOD] ;
                          <!Method!> [SCOPE <Scope>] => ;
          __clsModMsg( <Class>():classH, #<Message>, @<Method>(), ;
                       IIF( <.Scope.>, <Scope>, HB_OO_CLSTP_EXPORTED ) )


EMG
Posts: 47
Joined: Thu Jul 10, 2008 07:33 AM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 12:46 PM

Great! Do it! Thx a lot.

Jorge Ignacio Corral
Enjoy it :)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: OVERRIDE METHOD
Posted: Fri Mar 06, 2009 06:39 PM

Enrico,

Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion