Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing a parameter to a VFP .exe
Message
From
04/01/1999 22:12:51
 
 
To
04/01/1999 19:36:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00172595
Message ID:
00172631
Views:
30
>>>We need to pass a drive letter to our VFP .exe - this will allow us to create a shortcut on a client's system. He insists that he doesn't want the user to have to enter the drive letter of a cd tower. I just can't find how to pass the parameter.
>>>
>>
>>You need a PARAMETERS or LPARAMETERS statement in the main program module as the first executable statement in the module; if you want to be able to pass more than 1 parameter, you'll need more than one entry. For example:
>>
>>* MAIN.PRG
>>LPARAMETERS uParm1, uParm2, uParm3, uParm4, uParm5
>>
>>Would allow for 0 to 3 values to be passed in on the command line; use PCOUNT() to determine how many were actually passed in. If the program create is MyApp.EXE, yyou could invoke it with "I" as a value by having the command line:
>>
>>C:\MyDir\MyApp.EXE I
>>
>>All values passed on the command line will be recevied as a character value; if you need to pass in a character string that includes characters that are seens as delimiters (like spaces), encapsulate the string in "s:
>>
>>C:\MyDir\MyApp.EXE "Mary had a little lamb"
>>
>>would pass Mary had a little lamb as uParm1, with all others containing a logical .F. If instead, you started it with:
>>
>>C:\MyDir\MyApp.EXE Mary had a little lamb
>>
>>uParm1 would contain Mary, uParm2 would contain had, etc.
>>
>>Using LPARAMETERS scopes the parameters as local to MAIN; a PARAMETERS statement scopes the parameters as PRIVATE.
>>
>>>We would like to pass "I", for instance...
>>>
>>>We tried using
>>>
>>>I
>>>-I
>>>-"I"
>>>/I (this one worked, but it also sent the /
>>>
>>>I give up... :)
>>>
>>>Steve McMahon
>>>ZDI
>>>San Diego
>
>One more note...the parameters will always be passed as character.

I think I said that already; command line values are always received as character strings, if present, or a logical .F. if omitted. If you invoke a VFP .EXE from within another VFP .EXE via DO, you can pass values other than as characters.
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