Question to CLASS-Management

Question to CLASS-Management

Postby byte-one » Thu May 18, 2017 8:11 am

Can i replace a method in a class outside from the class-code?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Question to CLASS-Management

Postby Enrico Maria Giordano » Thu May 18, 2017 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8522
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Question to CLASS-Management

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Question to CLASS-Management

Postby byte-one » Thu May 18, 2017 12:04 pm

Thanks. Also in HARBOUR?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Question to CLASS-Management

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6522
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Question to CLASS-Management

Postby Enrico Maria Giordano » Thu May 18, 2017 12:55 pm

cnavarro wrote:Enrico

Some sample with clausule SCOPE ?


It should be PROTECT, HIDDEN, READONLY.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8522
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Question to CLASS-Management

Postby byte-one » Thu May 18, 2017 1: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Question to CLASS-Management

Postby Enrico Maria Giordano » Thu May 18, 2017 1:18 pm

Use

Code: Select all  Expand view
LOCAL Self := HB_QSELF()


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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8522
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Question to CLASS-Management

Postby byte-one » Thu May 18, 2017 1:26 pm

Thanks!!!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests