Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass and retrieve parameter for EXE
Message
From
05/04/1999 12:07:40
 
 
To
05/04/1999 11:57:33
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00205235
Message ID:
00205239
Views:
14
>Hi,
> Is there any way to pass and retrieve parameter from others application such as EXE compiled from VB?
>

You can accept command line parameters into a VFP executable by placing a PARAMETERS or LPARAMETERS statement at the beginning of your main program, and can pass command line parameters in a RUN command, or in an API invocation (ShellExecute(), ShellExecuteEx() and CreateProcess() all allow command line parameters to be passed in the API call.)

parameters passed via the command line to VFP will be received as strings; if you need to embed characters that might be treated as separator characters such as spaces or commas, you need to encapsulate the command line string in quotes (you must use the " character to delimit strings on a command line.) You must allow for a maximum number of parameters explicitly in your main, and will have to parse and handle the parameters in the parameter variables received. Any command line parameter not filled will contain a logical .F., and you can test the number of parameters passed using PCOUNT(). parameters will be scoped as private for a PARAMETERS statement, and local with an LPARAMETERS statement.

VB can retrieve command line parameters with the COMMAND$ variable. VB does no parsing of the command line, and returns a single string that the program must parse and interpret itself.

>Thank you
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