Page 1 of 1

Method Eval

Posted: Wed Sep 05, 2018 5:10 pm
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

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

Re: Method Eval

Posted: Mon Sep 10, 2018 10:22 am
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?

Re: Method Eval

Posted: Mon Sep 10, 2018 2:08 pm
by karinha

Re: Method Eval

Posted: Mon Sep 10, 2018 3:36 pm
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.

Re: Method Eval

Posted: Mon Sep 10, 2018 4:01 pm
by karinha
Ponha um METER e um SAY piscante, para ele ver, que está fazendo a tarefa. Escreva, <Aguarde, pode demorar...>

Abs.

Re: Method Eval

Posted: Mon Sep 10, 2018 4:10 pm
by karinha
Imagem do xBlite:

Image

Inspire-se,

Regards.