OVERRIDE METHOD

Post Reply
User avatar
jicorral
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am
Contact:

OVERRIDE METHOD

Post by jicorral »

I'm trying to replace HaldleEvento from TControl:

Code: Select all

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: Select all

ayuda1.PRG(17) Error E0030  Syntax error "syntax error at 'METHOD'"
Any idea?
Jorge Ignacio Corral
Enjoy it :)
User avatar
jicorral
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am
Contact:

Re: OVERRIDE METHOD

Post by jicorral »

I have it included:

Code: Select all

#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 :)
User avatar
jicorral
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am
Contact:

Re: OVERRIDE METHOD

Post by jicorral »

Harbour 902
Jorge Ignacio Corral
Enjoy it :)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: OVERRIDE METHOD

Post by Antonio Linares »

Jorge Ignacio,

Harbour does not support OVERRIDE METHOD yet

You need to use xHarbour to have it
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
jicorral
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am
Contact:

Re: OVERRIDE METHOD

Post by jicorral »

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 :)
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: OVERRIDE METHOD

Post by Enrico Maria Giordano »

This is from Przemek:

Code: Select all

#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
User avatar
jicorral
Posts: 47
Joined: Thu Jul 10, 2008 7:33 am
Contact:

Re: OVERRIDE METHOD

Post by jicorral »

Great! Do it! Thx a lot.
Jorge Ignacio Corral
Enjoy it :)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: OVERRIDE METHOD

Post by Antonio Linares »

Enrico,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply