Command Line Parameters 
Author Message
 Command Line Parameters

Quick question (I hope)

How does one capture command line parameters for use in a
FoxPro application?  I am using VFP3.0 in case that makes a
difference.

I would like to be able to specify a "work" directory on the
command line when users run my application.

Thanks for any help in advance,

Tom Clowers

or

Inc.)



Mon, 23 Mar 1998 03:00:00 GMT  
 Command Line Parameters

Quote:

>Quick question (I hope)
>How does one capture command line parameters for use in a
>FoxPro application?  I am using VFP3.0 in case that makes a
>difference.

I don't know whether it will make any difference (probably yes, but
only as to the name of snippet where to put the following), but in
FoxPro you just include "parameters <para1>[,<para2>...] in the setup
snippet of your main program.  If it is a screen and you use screen
builder, it should be preceded by "#SECTION1" directive (all without
quotes, of course). Then whatever parameters you type in the command
line are passed to your main program in order.

Quote:
>I would like to be able to specify a "work" directory on the
>command line when users run my application.

Whatever you want.  I use it to pass a string to the programs which is
compared to "debug".  If so, program works in debug mode (e.g. returns
to command window on end instead of executing QUIT).




Mon, 23 Mar 1998 03:00:00 GMT  
 Command Line Parameters

Quote:


>>Quick question (I hope)

>>How does one capture command line parameters for use in a
>>FoxPro application?  I am using VFP3.0 in case that makes a
>>difference.

>I don't know whether it will make any difference (probably yes, but
>only as to the name of snippet where to put the following), but in
>FoxPro you just include "parameters <para1>[,<para2>...] in the setup
>snippet of your main program.  If it is a screen and you use screen
>builder, it should be preceded by "#SECTION1" directive (all without
>quotes, of course). Then whatever parameters you type in the command
>line are passed to your main program in order.

>>I would like to be able to specify a "work" directory on the
>>command line when users run my application.

>Whatever you want.  I use it to pass a string to the programs which is
>compared to "debug".  If so, program works in debug mode (e.g. returns
>to command window on end instead of executing QUIT).

   While this works for programs, etc, what about a compiled EXE running
with the support libraries?  Can EXE's accept passed paramaters in the
same fashion?

--
David F. Severski



Mon, 23 Mar 1998 03:00:00 GMT  
 Command Line Parameters

Quote:
>How does one capture command line parameters for use in a
>FoxPro application?  I am using VFP3.0 in case that makes a
>difference.

>I would like to be able to specify a "work" directory on the
>command line when users run my application.

In your icon properties you have the command (of sorts) c:\vfp\vfp.exe

Now make a copy of it and in it's properties for the call put in
C:\VFP\VFP TEST HELLOWORLD
(no spaces in helloworld)

Now call VFP using your old icon and create this program called TEST

* Begin code for TEST.PRG
parameter textstring

=inkey(10)
quit
* End code for TEST.PRG

Now save it and compile it.... get out of VFP and hit your other icon and you will see
HELLOWORLD put onto the screen!

Jon



Tue, 24 Mar 1998 03:00:00 GMT  
 Command Line Parameters

Quote:



>>>How does one capture command line parameters for use in a
>>>FoxPro application?  I am using VFP3.0 in case that makes a
>>>difference.

[ put "parameters" at the beginning of main program ]

Quote:
>   While this works for programs, etc, what about a compiled EXE running
>with the support libraries?  Can EXE's accept passed paramaters in the
>same fashion?

Definetly!




Tue, 24 Mar 1998 03:00:00 GMT  
 Command Line Parameters
Thanks to all who answered this question.

It works great!

Tom Clowers
Programmer/Analyst
Expeditors International



Tue, 24 Mar 1998 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How are command line parameters passed/used?

2. Passing command line parameters to a VFP EXE

3. vfp6 command line parameters???

4. Command line parameters

5. Frustrated by command line parameters in visual foxpro 5

6. Foxpro 2.6 Debugger, Starting with Command Line Parameters

7. Command Line parameters

8. Passing command line parameters project EXE

9. vfp6 command line parameters???

10. Command Line Parameters

11. command line parameters in visual foxpro 5

12. newbie - command line parameters to open a .dbf?

 

 
Powered by phpBB® Forum Software