Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing paramters to my EXE
Message
From
30/08/1999 12:34:18
 
 
To
30/08/1999 12:22:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00259219
Message ID:
00259229
Views:
16
>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.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform