Change a Method
Publicado: Vie Mar 31, 2006 7:03 pm
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 !!!
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 !!!