FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Question to CLASS-Management
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Question to CLASS-Management
Posted: Thu May 18, 2017 08:11 AM

Can i replace a method in a class outside from the class-code?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 09:52 AM
From xdiff.txt:

OVERRIDE CLASS:
---------------

The OVERRIDE CLASS syntax allows the xHarbour developer to override the
behaviour of any existing class (including native type classes) using the
flowwing syntax:

OVERRIDE METHOD <SomeMethod> [IN] CLASS <SomeClass> WITH [METHOD] <SomeFunc>
[SCOPE <Scope>]

For sample usage please review tests\override.prg


EMG
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 11:54 AM

Enrico

Some sample with clausule SCOPE ?

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 12:04 PM

Thanks. Also in HARBOUR?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 12:17 PM
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 12:55 PM
cnavarro wrote:Enrico

Some sample with clausule SCOPE ?


It should be PROTECT, HIDDEN, READONLY.

EMG
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 01:05 PM

In the original method ::hDC by example is using. In the new function what i should use unstead the ::?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 01:18 PM
Use

Code (fw): Select all Collapse
LOCAL Self := HB_QSELF()


to retrieve the current object, so you can use the normal :: syntax.

EMG
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Question to CLASS-Management
Posted: Thu May 18, 2017 01:26 PM

Thanks!!!

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion