Method Eval

Post Reply
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Method Eval

Post by ORibeiro »

Is it possible to put SySRefresh () in Eval class while it runs the code block?

I ask why I have a problem when the code block is waiting too long to respond and the user clicks on the window. In this case, the application appears to be locked and the user drops the application.

Example:

Code: Select all

        MsgRun("Attention: The System has not locked! This routine will take a long time because of the size of your database. Wait until completion.",,{ | oDlg | ;
                lOkZip := hb_ZipFile( cFolderTargetZip  ,; // ZipFile (nome do zip)
                                      acFiles           ,; // File to Compress, pode ser array
                                      HBL_ZIPLEVEL      ,; // Nivel de compressão
                                      bOnZipFile        ,; // Codeblock a executar enquanto comprime
                                      XBL_ZIPOVERWRITE  ,; // Overwrite
                                      "1234"            ,; // Password
                                      XBL_ZIPWITHPATH   ,; // Armazena caminho (PATH)
                                      NIL             ) }) // Codeblock para file progress
 

// FiveWin CodeBlock Class

Code: Select all

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

CLASS TBlock

   DATA   cExpression
   DATA   bBlock

   METHOD New( cExpression ) CONSTRUCTOR

   METHOD Eval( uPar1, uPar2, uPar3, uPar4, uPar5 ) INLINE ;
                If( ::bBlock != nil,;
                Eval( ::bBlock, uPar1, uPar2, uPar3, uPar4, uPar5 ),)

   METHOD Exec( uPar1, uPar2, uPar3, uPar4, uPar5 ) INLINE ;
                If( ::bBlock != nil,;
                Eval( ::bBlock, uPar1, uPar2, uPar3, uPar4, uPar5 ),)

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New( cExpression ) CLASS TBlock

   if Type( cExpression ) $ "UEUI"
      MsgAlert( "Invalid expression at Block constructor" )
   else
      ::cExpression = cExpression
      ::bBlock      = &( cExpression )
   endif

return nil

//----------------------------------------------------------------------------//
 
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: Method Eval

Post by ORibeiro »

No one else is having problems with Eval in functions where the user needs to wait for the program to respond and the message appears that Windows is not responding?
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Method Eval

Post by karinha »

João Santos - São Paulo - Brasil
User avatar
ORibeiro
Posts: 174
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: Method Eval

Post by ORibeiro »

Obrigado pela ajuda João, mas o meu problema não é apenas com o Zip/Unzip. Mas toda vez que o usuário precisa esperar o sistema executar uma função que é demorada e eu não tenho como colocar Sysrefresh() nessa função, aparece no título da janela que o sistema não está respondendo e o usuário pensa que o sistema travou.

Thanks for the help John, but my problem is not just with Zip / Unzip. But every time the user needs to wait for the system to perform a function that is time consuming and I can not put Sysrefresh() on that function, it appears in the window title that the system is not responding and the user thinks the system has crashed.
_ Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Method Eval

Post by karinha »

Ponha um METER e um SAY piscante, para ele ver, que está fazendo a tarefa. Escreva, <Aguarde, pode demorar...>

Abs.
João Santos - São Paulo - Brasil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Method Eval

Post by karinha »

Imagem do xBlite:

Image

Inspire-se,

Regards.
João Santos - São Paulo - Brasil
Post Reply