>>If all you need is to terminate VFP and return a numeric status code, that's no problem, too - use the ExitProcess() API call to terminate VFP, and have it return an error code other than 0. Only integer values can be returned. There is a sample in the FAQ showing this.
>
>Could you provide a link to the FAQ or write out an example? I couldn't track down what you were referring to, besides the API call itself.
>
>A typical Tcl/Tk snippet might read like this:
>
>if {[exec MyVfpApp.exe -xf somefile.txt]} {
>---> set mystring "This is a test"
>}
>
>where [exec MyVfpApp.exe -xf somefile.txt] executes a command (the exec command, in this case) and substitutes its return code - note that the square brackes are what denote the substutution.
>
>exec's return code is the return code of the process it is executing - in this case, I am assuming that MyVfpApp.exe returns a zero for false and a non-zero for true.
>
The standard is that a WinApp or DOSApp returns 0 for successful shutdown, and any other value returned is an error condition - this is reflected as the DOS errorlevel, and is examinable with the GetExitCodeProcess() API call.
DECLARE ExitProcess IN Kernel32 SHORT uExitCode
CLOSE ALL
FLUSH
=ExitProcess(
numeric exit code to return)
Don't return an exitcode of 259; that's reserved for 'Not done yet'
makes its own sauce - you need to ensure that your Tcl/tk Exec macro does a CreateProcess() and waits on the app to terminate - you may have to use the START verb to force a wait - don't use Tcl myself.
>I also added three parameters (two flags and a positional) to demonstrate typical Unix-style parameter passing.
>
>What I want to know is whether executing ExitProcess() will properly return an integer in this manner, and how I would integrate this in my framework's shutdown routine.
Use ExitProcess() as shown above as an alternative to QUIT. Like I said, makes its own sauce. This Win32 stuff is easy...