Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning a value from a VFP exe
Message
De
17/04/2000 14:00:40
 
 
À
17/04/2000 13:41:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00359172
Message ID:
00360521
Vues:
14
>>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.

In terms of success or failure, Unix is the same way - to be blunt, the original DOS is simply Unix with the slashes pointed the wrong way ;)

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

The default on the exec command is to go into a wait statue until the executed command returns, with a syntax of [exec MyApp.exe parameters &] it will launch as an independent process.

You ought to try Tcl/Tk, for three reasons. One, it gives you an entrance into the Unix world, thus more career flexibility, Two, once you've written a Tcl/Tk macro, you'll never want to write a .cmd file ever again - the language even includes a comprehensive user interface. And three, it can be downloaded for free - just got to the Scriptics web site (www.scriptics.com).

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

Unfortunately, Tcl/Tk won't read ERRORLEVEL, since it's cross-platform to Windows, Unix (and Linux of course), and Macintosh.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform