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

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