Acabo de obtener FWH 11.09 y quisiera pedirles un pequeño cambio.
Se podría hacer que MsgRun() devuelva el valor retornado por la evaluación de bAction ?
- Code: Select all Expand view
function MsgRun( cCaption, cTitle, bAction )
LOCAL oDlg, nWidth, uRet //<---aca el cambio uRet
DEFAULT cCaption := "Please, wait...",;
bAction := { || WaitSeconds( 1 ) }
IF cTitle == NIL
DEFINE DIALOG oDlg ;
FROM 0,0 TO 3, Len( cCaption ) /*+ 4*/ ;
STYLE nOr( DS_MODALFRAME, WS_POPUP )
ELSE
DEFINE DIALOG oDlg ;
FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
TITLE cTitle ;
STYLE DS_MODALFRAME
ENDIF
oDlg:bStart := { || uRet:=Eval( bAction, oDlg ), oDlg:End(), SysRefresh() } //<---aca el cambio uRet
oDlg:cMsg := cCaption
nWidth := oDlg:nRight - oDlg:nLeft
ACTIVATE DIALOG oDlg CENTER ;
ON PAINT oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T. )
return uRet //<---aca el cambio uRet
De esta forma se podria hacer: cosa como:
- Code: Select all Expand view
:
if MsgRun(,,{|| lVerifica() })
msginfo("Exito")
else
msginfo("Fallo")
endif
:
Function lVerifica()
if date() < CTOD("01/01/2012")
return .T.
endif
return .F.
Atentamente,
Rolando.
Saludos desde Cochabamba, Bolivia.