Method Eval

Method Eval

Postby ORibeiro » Wed Sep 05, 2018 5:10 pm

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  Expand view  RUN

        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  Expand view  RUN

#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

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

Re: Method Eval

Postby ORibeiro » Mon Sep 10, 2018 10:22 am

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?
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: Method Eval

Postby karinha » Mon Sep 10, 2018 2:08 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Method Eval

Postby ORibeiro » Mon Sep 10, 2018 3:36 pm

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.
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: Method Eval

Postby karinha » Mon Sep 10, 2018 4:01 pm

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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Method Eval

Postby karinha » Mon Sep 10, 2018 4:10 pm

Imagem do xBlite:

Image

Inspire-se,

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests