Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No PARAMETER statement is found
Message
De
05/05/1999 12:31:42
 
 
À
05/05/1999 11:40:45
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00214951
Message ID:
00215392
Vues:
42
>>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
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