In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Change a Method

Foro público de Xailer en español
Responder
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

Change a Method

Mensaje por Aguiar Costa »

Hi
I tried to add a new parameter on AddCol() method from TBrowse class like
this :
*****
CLASS TBrowse FROM XBrowse
PUBLIC:
METHOD AddCol( oCol , lRefresh , cHeader )
ENDCLASS
METHOD AddCol( oCol , lRefresh , cHeader )
LOCAL oCol1 := SUPER:AddCol( oCol , lRefresh )
If !Empty(cHeader)
oCol1:cHeader := cHeader
EndIf
RETURN oCol1
*****
It works, the new column is created but with no header text.
Doing the same but changing the method's name it works just fine:
****
CLASS TBrowse FROM XBrowse
PUBLIC:
METHOD AddCol2( oCol , lRefresh , cHeader )
ENDCLASS
METHOD AddCol2( oCol , lRefresh , cHeader )
LOCAL oCol1 := SUPER:AddCol( oCol , lRefresh )
If !Empty(cHeader)
oCol1:cHeader := cHeader
EndIf
RETURN oCol1
****
What can i do to use the same method name and add a new parameter ?
TIA.
Aguiar !!!
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9463
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Change a Method

Mensaje por ignacio »

Aguiar,
It should work. Every thing seems to be correct. If lRefresh is .T. you may
need to provoke a new Refresh. Please send us a small sample.
Regards,
"Aguiar Costa" <Aguiar.Costa@Sisbit.pt> escribió en el mensaje
news:[email=442d6013@ozsrvnegro.ozlan.local...]442d6013@ozsrvnegro.ozlan.local...[/email]
> Hi
>
> I tried to add a new parameter on AddCol() method from TBrowse class like
> this :
> *****
> CLASS TBrowse FROM XBrowse
> PUBLIC:
> METHOD AddCol( oCol , lRefresh , cHeader )
>
> ENDCLASS
>
> METHOD AddCol( oCol , lRefresh , cHeader )
>
> LOCAL oCol1 := SUPER:AddCol( oCol , lRefresh )
>
> If !Empty(cHeader)
> oCol1:cHeader := cHeader
> EndIf
>
> RETURN oCol1
> *****
> It works, the new column is created but with no header text.
> Doing the same but changing the method's name it works just fine:
> ****
> CLASS TBrowse FROM XBrowse
> PUBLIC:
> METHOD AddCol2( oCol , lRefresh , cHeader )
>
> ENDCLASS
>
> METHOD AddCol2( oCol , lRefresh , cHeader )
>
> LOCAL oCol1 := SUPER:AddCol( oCol , lRefresh )
>
> If !Empty(cHeader)
> oCol1:cHeader := cHeader
> EndIf
>
> RETURN oCol1
> ****
> What can i do to use the same method name and add a new parameter ?
> TIA.
> Aguiar !!!
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder