>>Version 4.1 of the Developer's Guide on Page 49, they talk about "Passing Parameters to the Application" when running a compiled .exe from Windows or DOS. My understanding of the syntax would then be:
>>
>>c:\myDir\myApp.exe parm1
>>
>>When I try this I get the error. Any suggestions would be appreciated.
>>
>>Kind Regards,
>>
>>Mat
>
>Matt,
>There are two things you can do here...
>
>1. Make SETUP.PRG your projects 'main' file. Setup.prg accepts tuParameter and assigns it to a global variable guParameter. Beware this global is released after goApp is initialized, so you have to assign or act on guParameter in the Init of your application class.
>
>2. Modify your Main.prg as follows. (As Barbara says, Main is specific to each application NOT the framework...)
>
>LPARAMETERS xAppParam
>#INCLUDE 'INCLUDE\APPINCL.H'
>DO COMMONPATH\PROGS\Setup with xAppParam
>
>*******
>That will pass the paramater from Main to Setup... which will also allow you to use your parmeters when you are running the ap with DO MAIN at the command line.
>
Also, realize that this will only pick up the first parameter on the line; for example:
MyApp Mary had a little lamb
has 5(!) parameters. If you want to pass a complex parameter that may include separator characters, make certain to enclose it in quotes, ie:
MyApp "Mary had a little lamb"
Quote encapsulation can also be used to avoid VFP from stripping command elements prefixed with / or - from the parameter list.
>BOb