Saludos al Forun
Tengo 2 preguntas
1.
Como saber si un Method existe en la clase
2.
Como saber si un Function existe.
Como saber si un Method existe en la clase
Moderador: Moderadores
-
Ruben Dario
- Usuário Nível 3

- Mensagens: 127
- Registrado em: 14 Jun 2015 23:19
- Localização: Colombia
-
alxsts
- Colaborador

- Mensagens: 3092
- Registrado em: 12 Ago 2008 15:50
- Localização: São Paulo-SP-Brasil
Como saber si un Method existe en la clase
Olá!
Ruben Dario escreveu:Como saber si un Method existe en la clase
Código: Selecionar todos
Function Main()
LOCAL oObj := SomeClass():new()
Setmode(25,80)
If __objHasMethod( oObj, "SomeMethod" )
hb_Alert( "Método existe" )
Else
hb_Alert( "Método não existe" )
Endif
RETURN NILRuben Dario escreveu:Como saber si un Function existe.
Código: Selecionar todos
Function Main()
Setmode(25,80)
cls
If Type( "TestFunc()" ) == "UI"
hb_Alert( 'Funcão "TestFunc()" existe' )
Else
hb_Alert( 'Funcão "TestFunc()" nao existe' )
EnDif
If Type( "xpt()" ) == "UI"
hb_Alert( 'Funcão "xpt()" existe' )
Else
hb_Alert( 'Funcão "xpt()" não existe' )
EnDif
RETURN NIL
FUNCTION TestFunc()
RETURN NIL
[]´s
Alexandre Santos (AlxSts)
Alexandre Santos (AlxSts)
-
Ruben Dario
- Usuário Nível 3

- Mensagens: 127
- Registrado em: 14 Jun 2015 23:19
- Localização: Colombia
- Itamar M. Lins Jr.
- Administrador

- Mensagens: 7928
- Registrado em: 30 Mai 2007 11:31
- Localização: Ilheus Bahia
- Curtiu: 1 vez
Como saber si un Method existe en la clase
Ola!
Saudações,
Itamar M. Lins Jr.
Código: Selecionar todos
>hbmk2 -find hb_isfunc
Núcleo Harbour (instalado):
hb_IsFunction()
IF hb_IsFunction( "dbRelation" )
Núcleo Harbour (instalado):
HBProfileMethod()
hb_MethodName()
__objAddMethod()
__objDelMethod()
__objGetMethodList()
__objHasMethod()
__objModMethod()
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Itamar M. Lins Jr.
-
alxsts
- Colaborador

- Mensagens: 3092
- Registrado em: 12 Ago 2008 15:50
- Localização: São Paulo-SP-Brasil