>I want to create an EXE from an application and pass parameters to my main program like this
>
>Mainprog.exe param1 param2 param3
>
>how do i write my code in foxpro
>
Add a PARAMETERS or LPARAMETERS statement as the first executable line of your main .PRG file (or the Init() of a modal form if you start your app from a modal form.) VFP will accept command line arguments as strings. if a string passed on the command line needs to contain a space or other delimiter, the string needs to be contained within double quotes
" or the command line parser will pass the parameters as several arguments eg:
LPARAMETER uArg1, uArg2, uArg3, uArg4, uArg5, uArg6
MYApp.EXE Mary had a little lamb
will get 5 parameters filled (PCOUNT() = 5)
MyApp.EXE "Mary had a little lamb"
will get 1 parameter (PCOUNT() = 1).
Some command line switches will be stripped by the VFP engine, so avoid the use of - and / prefixing of arguments if at all possible.