Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing paramaters to an exe from command line
Message
From
28/01/1999 11:53:39
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00181105
Message ID:
00181379
Views:
14
>>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!

JD
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform