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.
- 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