Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a command line switch to an application?
Message
De
23/07/2001 18:34:18
 
 
À
23/07/2001 18:10:59
Thomas Ianuzzi
Information Security Consultants, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00534142
Message ID:
00534156
Vues:
13
>I have produced an executalbe and would like to pass it a file name in the command line such as
>
>run myexecutable.exe /filename.txt

Is your executable a VFP executable or non-VFP?

If VFP and you're starting it from the command window or a shortcut, you can issue
myexecutable filename.txt
and the parameter filename.txt will appear in the VFP executable as a character parameter. The first line of your VFP's main executable must be LPARAMETERS or PARAMETERS.

If VFP and you're calling it from another VFP application, simply
DO MyExecutable WITH "filename.txt"
You can pass parameters of any type this way. Here your VFP executable must start with LPARAMETERS or PARAMETERS again.

If non-VFP and you're trying to call it from within VFP, your executable must be set to receive the parameter. Your existing call should work; you could try it without the / before the filename. You can also look at ShellExecute and/or Ed Rauh's API_APPRUN available here for download.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform