nowait

nowait

Postby Silvio.Falconi » Fri Mar 10, 2023 10:56 am

Image


I open dbf with tdatabase why make error ?


is it possible to use a dialog in source (and not in resource) using the NOWAIT clause?

Meaning what

DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
FONT oFont COLOR CLR_BLACK, DLG_nColorDlg

ACTIVATE DIALOG oDlg NOWAIT



RETURN (NIL)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: nowait

Postby karinha » Fri Mar 10, 2023 3:24 pm

Hello, you must show how you are doing the OPENING of the Database, because the ERRSYSW.prg is saying that the OPEN AREA IS NOT IN USE.

Hola, debes mostrar como estas haciendo la APERTURA de la Base de Datos, porque el ERRSYSW.prg esta diciendo que el AREA ABIERTA NO ESTÁ EN USO.

And why does this DIALOGUE need to be NOWAIT?

¿Y por qué este DIÁLOGO necesita ser NOWAIT?

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

Re: nowait

Postby cmsoft » Fri Mar 10, 2023 9:36 pm

Se que no es lo que necesitas porque usas tdatabase, pero tal vez te de un hilo para seguir.
Code: Select all  Expand view

#include "FiveWin.ch"
static oWnd
static lEnd := .f., nArea
//----------------------------------------------------------------------------//
function Main()
nArea := 0
   DEFINE WINDOW oWnd TITLE "Dialogo NoWait"

   @ 2,  2 BUTTON "&Start" SIZE 80, 20 ACTION StartTest()
   @ 2, 20 BUTTON "&Info" SIZE 80, 20 ACTION MsgInfo(select())
   @ 2, 40 BUTTON "&Close Area" SIZE 80, 20 ACTION dbclosearea(select()) // Esto es para que de error al querer volver a ese dialogo nowait
   ACTIVATE WINDOW oWnd MAXIMIZED
return nil

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

function StartTest()
   local oDlg
   local oBrw   , n
   nArea ++
   n := nArea
   USE Customer ALIAS "customer"+ALLTRIM(STR(nArea)) SHARED NEW
   INDEX ON Field->State TO State
   SET ORDER TO "State"
      DEFINE DIALOG oDlg TITLE "No Wait Customer"+ALLTRIM(STR(nArea)) FROM 10, 10 TO 23, 70 RESIZABLE
      @ 01,01 XBROWSE oBrw OF oDlg ;
        LINES STYLE FLAT NOBORDER ;
        COLUMNS "State","City", "Last", "First" ;
        HEADERS "State","City", "Last", "First" PIXEL SIZE 200,70
      oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
      oBrw:CreateFromCode()  
      oBrw:bGotFocus := {|| dbselectarea(oBrw:cAlias)}
      ACTIVATE DIALOG oDlg NOWAIT VALID(Cerrar(n))
      SysRefresh()
return nil

STATIC FUNCTION Cerrar(n)
dbclosearea( "customer"+ALLTRIM(STR(nArea)))
RETURN .t.
//----------------------------------------------------------------------------//
 

Los xbrowse con dialogos nowait funcionan bien, pero si cerramos un area de un dialogo que esta activo, ahi obtenemos el error.
Intuyo que por ese lado viene el problema
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: nowait

Postby nageswaragunupudi » Mon Mar 13, 2023 2:32 am

Silvio.Falconi wrote:Image


I open dbf with tdatabase why make error ?


is it possible to use a dialog in source (and not in resource) using the NOWAIT clause?

Meaning what

DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
FONT oFont COLOR CLR_BLACK, DLG_nColorDlg

ACTIVATE DIALOG oDlg NOWAIT



RETURN (NIL)



Yes.
But close the oDbf in the valid clause but not after activate command.

This works for modal dialigs ( not nowait):
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg
   oDbf:Close()
return nil
 

But this does not work for non-midal ( NOWAIT) dialogs.
Results in the same error as above.

WRONG
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg NOWAIT
   oDbf:Close()
return nil
 


CORRECT WAY
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg NOWAIT ;
      VALID ( oDbf:Close(), .T. )
return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10247
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: nowait

Postby Silvio.Falconi » Mon Mar 13, 2023 7:49 am

thanks I resolved with Cesar
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: nowait

Postby Silvio.Falconi » Mon Mar 13, 2023 8:20 am

nageswaragunupudi wrote:
Silvio.Falconi wrote:Image



WRONG
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg NOWAIT
   oDbf:Close()
return nil
 


CORRECT WAY
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg NOWAIT ;
      VALID ( oDbf:Close(), .T. )
return nil
 


WELCOME BACK AMONG US
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: nowait

Postby Antonio Linares » Mon Mar 13, 2023 11:13 am

So glad to see you here with us Dear Rao :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: nowait

Postby Silvio.Falconi » Mon Mar 13, 2023 11:15 am

nageswaragunupudi wrote:
Silvio.Falconi wrote:Image



CORRECT WAY
Code: Select all  Expand view

   ACTIVATE DIALOG oDlg NOWAIT ;
      VALID ( oDbf:Close(), .T. )
return nil
 



Nages,
I made as you wrote me
Code: Select all  Expand view
 
ACTIVATE DIALOG oDlg NOWAIT ;
      VALID ( oDbf:Close(), .T. )
 


but sometimes have the same error when there is only one dialog opened
it not happened with more dialog opened with same or more dbf

it happen because on xbrowse I have a small menupopup



Image


Code: Select all  Expand view

  oBrw:bRClicked := {|nRow,nCol| MenuContextual(nRow,nCol,oDlg,oBrw,oArticoli) }
 


and the function MenuContextual
Code: Select all  Expand view

Function MenuContextual(nRow,nCol,oDlg,oBrw,oDbf )
   local oMenu

           MENU oMenu POPUP 2015

       
           MENUITEM "al primo record  " +space(6)+ CHR(VK_TAB) + "Ctrl+Home";
              MESSAGE "Mostra la lista dal primo record";
              RESOURCE "GRID_TOP";
              ACTION oBrw:KeyDown(VK_HOME, 0)  WHEN oDbf:OrdKeyCount() > 0

            MENUITEM "a pagina prec.  " +space(6)+ CHR(VK_TAB) + "Pag. Sù";
              MESSAGE "Mostra la lista della pagina precedente";
                RESOURCE "GRID_PREVIOUS";
              ACTION oBrw:KeyDown(VK_PRIOR, 0) WHEN oDbf:OrdKeyCount() > 0

            MENUITEM "al precedente record  " +space(6)+ CHR(VK_TAB) + "Indietro";
              MESSAGE "Mostra la lista muovendosi  al record precedente ";
                RESOURCE "GRID_UP";
              ACTION oBrw:KeyDown(VK_UP, 0)   WHEN oDbf:OrdKeyCount() > 0

            MENUITEM "avanti di un record  " + CHR(VK_TAB) +space(6)+ "Avanti";
              MESSAGE "Mostra la lista muovendosi al record avanti";
                RESOURCE "GRID_DOWN";
              ACTION oBrw:KeyDown(VK_DOWN, 0)  WHEN oDbf:OrdKeyCount() > 0

            MENUITEM "a pag. avanti  " +space(6)+ CHR(VK_TAB) + "Pag. Giù";
              MESSAGE "Mostra la lista della pagina avanti";
               RESOURCE "GRID_NEXT";
              ACTION oBrw:KeyDown(VK_NEXT, 0)  WHEN oDbf:OrdKeyCount() > 0

            MENUITEM "all'ultimo record  " +space(6)+ CHR(VK_TAB) + "Ctrl+End";
              MESSAGE "Mostra la lista all'ultimo record";
                RESOURCE "GRID_BOTTOM";
              ACTION oBrw:KeyDown(VK_END, 0)  WHEN oDbf:OrdKeyCount() > 0
         ENDMENU
   ACTIVATE POPUP oMenu OF oDlg AT  oBrw:nTop+nRow, oBrw:nLeft+nCol
     return oMenu
Last edited by Silvio.Falconi on Mon Mar 13, 2023 11:45 am, edited 2 times in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6768
Joined: Thu Oct 18, 2012 7:17 pm

Re: nowait

Postby Enrico Maria Giordano » Mon Mar 13, 2023 11:22 am

Antonio Linares wrote:So glad to see you here with us Dear Rao :-)


I'm happy for Rao recovery too!
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: nowait

Postby nageswaragunupudi » Tue Mar 14, 2023 7:27 am

Thank you
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10247
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests