A Question about WAITRUN

A Question about WAITRUN

Postby ukoenig » Fri Jul 03, 2009 3:03 pm

Hello,

using WAITRUN, there is no stop of the called Application :
The Situation :

1. Creating a PRG-file with given values.
2. Open Wordpad, to show the created PRG.
3. Compile the PRG.
4. Open the created EXE-file.

The same time Wordpad opens the PRG-file, the Compile runs allready in the Background.
You can see the DOS-Window behind Wordpad.
Wordpad doesn't wait. It works, but I want to compile after Wordpad is closed.

Image

Code: Select all  Expand view

FUNCTION MAKE_EXE()

cNewFile := c_path + "\TESTTOOL.PRG"
cNewFile1 := c_path + "\TESTTOOL.EXE"

DELETE FILE  "&cNewFile"
DELETE FILE   "&cNewFile1"

CREATE_DAT() // Creates the PRG-File

IF FILE ( c_path + "\TESTTOOL.PRG" )
   cOpen := "Write.exe " + "&cNewFile" // Starts Write and opens the PRG
   WAITRUN( "&cOpen" ) // Write doesn't wait !!!!!
   WAITRUN( "GOTEST.BAT"  )
   IF FILE( c_path + "\TESTTOOL.EXE" )
      IF MsgYesNo( "Do you want to run : TESTTOOL.exe ?","TESTTOOL")       
         Winexec( "TESTTOOL.EXE" )
      ENDIF
   ELSE
      MsgAlert( "The file : TESTTOOL.EXE " + CRLF + ;
      "is not created !","Error" )
   ENDIF
ELSE
   MsgAlert( "The File : " + CRLF + ;
   "TESTTOOL.PRG" + CRLF + ;
   "is not created !", "Error" )
ENDIF

RETURN NIL
 

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A Question about WAITRUN

Postby nageswaragunupudi » Sat Jul 04, 2009 9:01 am

Please use WordPad.Exe instead of Write.Exe. Place WordPad.Exe in the application path.
Regards

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

Re: A Question about WAITRUN

Postby ukoenig » Sat Jul 04, 2009 10:18 am

Rao,

thank You very much.
With these changes it is working now, like expected.
I think, to include < Notepad.exe > in the Zip-File ( only 151 KB ) is no problem ),
otherwise I have to explain, what to do.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A Question about WAITRUN

Postby nageswaragunupudi » Sat Jul 04, 2009 10:32 am

I advised WordPad.Exe, not NotePad.Exe.
Both are fine for WaitRun.
But WordPad.exe is the same as Write.Exe
But waitrun works for wordpad.exe ( this exe is in accessories folder.)

All windows users have wordpad.exe. I am not sure but I think there is nothing wrong in your providing wordpad.exe along with your application
Regards

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

Re: A Question about WAITRUN

Postby Otto » Tue Oct 13, 2009 12:45 pm

>using WAITRUN, there is no stop of the called Application


Hello Uwe,
did you find out why your application didn't stop. I have the same problem.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: A Question about WAITRUN

Postby ukoenig » Tue Oct 13, 2009 3:40 pm

Hello Otto,

I just tested with the new WORDPAD 2009 from Windows 7.
You can download it for Free.
It works fine, but didn't load Files with Extension .PRG.
I had to rename to .TXT to get it working.

Image

After some Vista-Updates, there is a Problem with my old Install.
I don't know, where this Nonsens comes from.
I copied Write.exe and it works :

Image

Image

Code: Select all  Expand view


FUNCTION MAKE_EXE()

cNewFile := c_path + "\PROJECT.prg"
cNewFile1 := c_path + "\PROJECT.EXE"

DELETE FILE  "&cNewFile"
DELETE FILE   "&cNewFile1"

NEW_SOURCE()

IF FILE ( c_path + "\PROJECT.PRG" )
    // File exists open with Editor
    WAITRUN( "Wordpad2009.exe " + c_path + "\PROJECT.txt" ) // copy from .PRG
    // Close Editor and create EXE-File
    IF MsgYesNo( "Do you want to Create / Run : PROJECT.exe ?","PROJECT")   
        WAITRUN( "GO.BAT"  )
        IF FILE ( c_path + "\PROJECT.EXE" )
            WINEXEC( "PROJECT.EXE" )
        ELSE
            MsgAlert( "The file : PROJECT.EXE " + CRLF + ;
                  "is not created !","Error" )
        ENDIF
    ENDIF
ELSE
    MsgAlert( "The File : " + CRLF + ;
            "PROJECT.PRG" + CRLF + ;
            "is not created !", "Error" )
ENDIF
SYSREFRESH()

RETURN NIL

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


FUNCTION NEW_SOURCE()

cNewFile := c_path + "\PROJECT.PRG"
IF FILE ("&cNewFile")
    DELETE FILE  "&cNewFile"
ENDIF

oText := TTxtFile():New( "&cNewFile" )

IF oText:Open()
    oText:Add('#include "FiveWin.ch"')
    oText:Add('#include "TTitle.ch"')
    oText:Add('#include "Image.ch"')
    oText:Add("")
    oText:Add("static oButtFont" )
    oText:Add("")
    oText:Add("FUNCTION Main()")
    oText:Add('LOCAL oWnd, oBtn1, oBtn2, hDC, oBrush, oImage')
    oText:Add("LOCAL nWidth := GetSysMetrics(0)")
    oText:Add("LOCAL nHeight := GetSysMetrics(1)")
    oText:Add("")

...
...
...

                // some more Textlines
    TITLE_PART( oText )

    oText:Close()
ENDIF

RETURN(  NIL )
 



Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A Question about WAITRUN

Postby Otto » Tue Oct 13, 2009 4:39 pm

Hello Uwe,
If I use waitrun like this - waitrun does not wait!



MENUITEM ("Adressenimport &Schnittstellen") + chr(9) + "Strg + S" ;
ACTION (waitRun("xImport.exe",0), oLbxX:upstable(), oLbxX:refresh(),oLbxX:gobottom(), oLbxX:SetFocus() );
ACCELERATOR ACC_CONTROL, asc("S");
MESSAGE "Adressenimport Schnittstellen"


This code works.

Code: Select all  Expand view

                     MENUITEM ("Adressenimport &Schnittstellen") + chr(9) + "Strg + S" ;
                        ACTION (runIMPORT_alle(oWnd), oLbxX:upstable(), oLbxX:goBottom(),oLbxX:refresh(), oLbxX:SetFocus() );
                        ACCELERATOR ACC_CONTROL, asc("S");
                        MESSAGE "Adressenimport Schnittstellen"


function runIMPORT_alle(oWnd)
LOCAL oDlgSome

   DEFINE DIALOG oDlgSome  
         ACTIVATE DIALOG oDlgSome CENTERED ON INIT ( WAITRUN("xImport.exe"), oDlgSome:End() )

RETURN NIL

 


Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 61 guests

cron