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.

TLabel X Function()

Foro público de Xailer en español
Responder
Avatar de Usuario
emeasoft
Mensajes: 1088
Registrado: Mié Abr 01, 2009 4:12 pm
Ubicación: emeasoft
Contactar:

TLabel X Function()

Mensaje por emeasoft »

Boa tarde,
Sou iniciante em Xailer e queria entender como fazer isto:
No TLabel informamos o conteúdo abaixo, por ex:
::oMsg:nClrText:=clRed
::oMsg:nClrPane:=clYellow
::oMsg:cText:="OK"
Como fazer para preencher a TLabel através de uma Function()?
Ex:
MSG(1,"OK")
FUNCTION MSG(f1,f2)
IF f1=1
::oMsg:nClrPane:=clGreen
::oMsg:nClrText:=clYellow
ELSEIF f1=2
::oMsg:nClrText:=clRed
::oMsg:nClrPane:=clYellow
ENDIF
::oMsg:cText:=f2
RETURN .T.
Ao compilar acusa:
Warning W0001 Ambiguos referente: 'SELF' e não funciona.
grato
Mário
www.eMeAsOfT.com.br
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

TLabel X Function()

Mensaje por jfgimenez »

Mário,
Msg( ::oMsg, 1, "OK" )
FUNCTION Msg( oMsg, f1, f2 )
IF f1=1
oMsg:nClrPane:=clGreen
oMsg:nClrText:=clYellow
ELSEIF f1=2
oMsg:nClrText:=clRed
oMsg:nClrPane:=clYellow
ENDIF
oMsg:cText:=f2
RETURN .T.
--
Un saludo,
José F. Giménez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
jrcsistemas
Mensajes: 180
Registrado: Lun Sep 15, 2008 2:53 pm

TLabel X Function()

Mensaje por jrcsistemas »

Mário yo uso METHOD en lugar de FUNCTION
Ej:
CLASS TFormDetalleCtaCte FROM TForm
COMPONENT .....
COMPONENT.....
METHOD MostrarDatos( nF1, cF2 )
METHOD ......
METHOD.....
ENDCLASS
Y abajo
METHOD MostrarDatos( nF1, cF2 ) CLASS TFormDetalleCtaCte
IF nF1=1
::oMsg:nClrPane:=clGreen
::oMsg:nClrText:=clYellow
ELSEIF nF1=2
::oMsg:nClrText:=clRed
::oMsg:nClrPane:=clYellow
ENDIF
::oMsg:cText:= cF2
Return Nil
Para llamarlo usa ::MostrarDatos( 1, "Hola" )
Juan
"Mário Angelini" <mario@emeasoft.com.br> escribió en el mensaje
news:49d651a1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Boa tarde,
> Sou iniciante em Xailer e queria entender como fazer isto:
>
>
> No TLabel informamos o conteúdo abaixo, por ex:
> ::oMsg:nClrText:=clRed
> ::oMsg:nClrPane:=clYellow
> ::oMsg:cText:="OK"
>
>
>
> Como fazer para preencher a TLabel através de uma Function()?
> Ex:
> MSG(1,"OK")
>
>
> FUNCTION MSG(f1,f2)
> IF f1=1
> ::oMsg:nClrPane:=clGreen
> ::oMsg:nClrText:=clYellow
> ELSEIF f1=2
> ::oMsg:nClrText:=clRed
> ::oMsg:nClrPane:=clYellow
> ENDIF
> ::oMsg:cText:=f2
>
> RETURN .T.
>
> Ao compilar acusa:
> Warning W0001 Ambiguos referente: 'SELF' e não funciona.
>
> grato
> Mário
> www.eMeAsOfT.com.br
Avatar de Usuario
emeasoft
Mensajes: 1088
Registrado: Mié Abr 01, 2009 4:12 pm
Ubicación: emeasoft
Contactar:

TLabel X Function()

Mensaje por emeasoft »

Perfeito!!!!
Thanks
"Mário Angelini" <mario@emeasoft.com.br> escreveu na mensagem
news:49d651a1$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Boa tarde,
> Sou iniciante em Xailer e queria entender como fazer isto:
>
>
> No TLabel informamos o conteúdo abaixo, por ex:
> ::oMsg:nClrText:=clRed
> ::oMsg:nClrPane:=clYellow
> ::oMsg:cText:="OK"
>
>
>
> Como fazer para preencher a TLabel através de uma Function()?
> Ex:
> MSG(1,"OK")
>
>
> FUNCTION MSG(f1,f2)
> IF f1=1
> ::oMsg:nClrPane:=clGreen
> ::oMsg:nClrText:=clYellow
> ELSEIF f1=2
> ::oMsg:nClrText:=clRed
> ::oMsg:nClrPane:=clYellow
> ENDIF
> ::oMsg:cText:=f2
>
> RETURN .T.
>
> Ao compilar acusa:
> Warning W0001 Ambiguos referente: 'SELF' e não funciona.
>
> grato
> Mário
> www.eMeAsOfT.com.br
Responder