Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
External Program Parameters
Message
De
29/10/1998 03:49:54
 
 
À
29/10/1998 02:16:52
Wim Dieke
Tranquility Bv
Almere, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00152128
Message ID:
00152152
Vues:
22
>Maybe silly, but at the moment we're not able to accept pararmeters that are passed to the .exe file, for instance "myapp.exe /s"
>
>We've been looking in the helpfiles extensively, but were not able to find anything. Please help!

It's pretty straightforward to do this. In order to accept command line parameters, you need to have a PARAMETERS (or LPARAMETERS) statement as the first executable line of your main program. For example, if you wanted to accept up to 3 command line arguments, and make them available to a parser in an argument array:
PARAMETERS uArg1, uArg2, uArg3  && as many as you think you might need
*  Save the parameters in an array for later use in this case
LOCAL nParmCount, i
DECLARE aParms[1]
aParms = NULL
nParmCount = PCOUNT()
FOR i = 1 TO nParmCount
   DECLARE aParms[i]
   aParms[i] = EVAL('uArg'+ALLTRIM(STR(i))
ENDFOR
IF nParmCount > 0
   *  Pass the array of parameters to your command line parser or whatever
ENDIF
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform