Picture Condicionado
Publicado por BILLY FERNANDEZ (2 intervenciones) el 04/09/2011 19:06:12
Buenos gracias a este foro y a todos los colaboradores, mi primera duda en este foro, estoy iniciando y hago una aplicación tipo Bitacora, debo de indicar el numero de identificación de la persona que se atiende pero existe diferentes tipos de identificaciòn, va por categoria: NACIONAL, EXTRANJERO CON IDE SEGURO SOCIAL, EXTRANJERO CEDULA RECIDENCIA, EXTRANJERO PASAPORTE. Bueno hice una dialog con cPelles y coloque lo campos de luego por codigo utilizo REDEFINE GET para asi indicar las variables y los Pictures que se utilizaran, un valor de un caracter es el que sirve como guia para saber cual Picture debo utilizar!
REDEFINE Get oP:oGet00 VAR cTipo ID 4013 OF oDlg FONT oFont PICTURE "!" VALID Verifica(cTipo)
y esto hace la función Verifica:
Function Verifica(cTipo)
do case
case cTipo = "0"
* MsgInfo("NACIONAL")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9-9999-9999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
case cTipo = "1"
* MsgInfo("EXTRANJERO CON NUMERO DE SEGURO SOCIAL")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9-99-9999999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
case cTipo = "2"
* MsgInfo("EXTRANJERO CEDULA RECIDENCIA")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9999-9999-9999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
casE cTipo = "3"
* MsgInfo("EXTRANJERO CON PASAPORTE")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont ;
PICTURE "999999999999!";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
otherwise
MsgInfo(" Debe indicar un valor entre 0 - 3 ")
oP:oGet00 = ""
cTipo = ""
Return .F.
endcase
Return .t.
*** PERO NO FUNCIONA LAS MASCARA DEL GET NUNCA CAMBIA, NO SE QUE ESTOY HACIENDO MAL, O MAS BIEN NO SE COMO HACER ESTO, CREO QUE LO HAGO BIEN PERO NO ESTOY SEGURO, APENAS TENGO UNOS DIAS DE HABER INICIADO A PROGRAMAR EN FIVEWIN!
Gracias de antemano por su ayuda!
REDEFINE Get oP:oGet00 VAR cTipo ID 4013 OF oDlg FONT oFont PICTURE "!" VALID Verifica(cTipo)
y esto hace la función Verifica:
Function Verifica(cTipo)
do case
case cTipo = "0"
* MsgInfo("NACIONAL")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9-9999-9999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
case cTipo = "1"
* MsgInfo("EXTRANJERO CON NUMERO DE SEGURO SOCIAL")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9-99-9999999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
case cTipo = "2"
* MsgInfo("EXTRANJERO CEDULA RECIDENCIA")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont;
PICTURE "9999-9999-9999";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
casE cTipo = "3"
* MsgInfo("EXTRANJERO CON PASAPORTE")
REDEFINE Get oP:oGet01 VAR oP:Ident ID 4002 OF oDlg FONT oFont ;
PICTURE "999999999999!";
UPDATE
oP:oGet01:Refresh()
oDlg:Update()
otherwise
MsgInfo(" Debe indicar un valor entre 0 - 3 ")
oP:oGet00 = ""
cTipo = ""
Return .F.
endcase
Return .t.
*** PERO NO FUNCIONA LAS MASCARA DEL GET NUNCA CAMBIA, NO SE QUE ESTOY HACIENDO MAL, O MAS BIEN NO SE COMO HACER ESTO, CREO QUE LO HAGO BIEN PERO NO ESTOY SEGURO, APENAS TENGO UNOS DIAS DE HABER INICIADO A PROGRAMAR EN FIVEWIN!
Gracias de antemano por su ayuda!
Valora esta pregunta
0