Non capisco come posso stabilire quando un 'DIALOG' non e' piu'
presente dal momento che il suo valtype risulta ancora 'O'
dopo aver applicato il metodo end (oDlg:end())
Allego un esempio di prova.
- Code: Select all Expand view RUN
#include "FiveWin.ch"
*------------------------------------------------------------
FUNCTION Main()
*------------------------------------------------------------
local oDlg
local nI1 := 1
local lOk := .F.
local cCod := space(10)
DEFINE DIALOG oDlg TITLE "Test"
@ 01, 03 GET cCod UPDATE PICTURE "@!"
@ 03, 05 BUTTON "&Ok" SIZE 40, 12 ACTION (lOk := .T., oDlg:End())
@ 03, 16 BUTTON "&Cancel" SIZE 40, 12 ACTION (lOk := .F., oDlg:End())
ACTIVATE DIALOG oDlg CENTERED VALID OkExit(lOk, oDlg)
alert(valtype(oDlg))
return nil
*------------------------------------------------------------
FUNCTION OkExit (lOk, oWnd)
*------------------------------------------------------------
local lRet := .T.
sysrefresh()
IF lOk
MsgMeter( { | oMeter, oText, oDlg, lEnd | lRet := Elabora( oMeter, oText, oDlg, @lEnd, oWnd ) },;
"Elabora", "Attendere..." )
if lRet
Chiudi()
endif
return(lRet)
else
Chiudi()
return(.T.)
endif
return(.F.)
*------------------------------------------------------------
FUNCTION Elabora( oMeter, oText, oDlg, lEnd, oWnd )
*------------------------------------------------------------
local nI1 := 1
sysrefresh()
oMeter:nTotal := 10000
FOR nI1 := 1 TO 10000
oMeter:Set(nI1)
NEXT
oWnd:update()
return(.T.)
*------------------------------------------------------------
FUNCTION Chiudi
*------------------------------------------------------------
sysrefresh()
MsgAlert("Uscita", "Avviso")
return(nil)
Grazie a tutti