Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing paramaters to an exe from command line
Message
De
28/01/1999 12:13:04
 
 
À
28/01/1999 11:53:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00181105
Message ID:
00181395
Vues:
16
>>>I thought I had read somewhere that you could design your project so that when compiled it would accept parameters from the command line (the names of the files upone which the program is to operate for instance). I have not been able to find it in the help facility. Is there a way to do this?
>>
>>Yes. The MAIN program for your .EXE should have appropriate LPARAMETER or PARAMETERS statements; if any arguments are passed on the command line, they'll be pulled in as character strings If your main program starts with the line:
>>
>>LPARAMETERS uVar1, uVar2, uVar3
>>
>>then up to three command line parameters could be accepted by the program - if there are fewer command line parameters specified, the 'excess' parameters will be set to logical .F.
>>
>>If you need to pass a command line parameter that includes embedded delimiters like spaces, enclose it in double quotes (") on the commmand line. if your app has the LPARAMETERS statement above, and you start the app with the command:
>>
>>MyApp Today Is Wednesday
>>
>>UVar1 will be set to "Today", uVar2 to "Is" and uVar3 to "Wednesday", while if you start it with
>>
>>MyApp "Today Is Wednesday"
>>
>>uVar1 will be set to "Today Is Wednesday", and uVar2 and uVar3 will be logical .F.
>>
>>You can only pass character strings on the command line. To pass a number or date, you'll have to invoke VFP functions like VAL() and CTOD() to convert them for you.
>Ed:
>
>Thanks so much for your help!

No problem.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform