Re: Command Line parameter for executible



Yes,
Just declare as many parameters as you may include in the command line and then place a PARAMETERS statement in your Main program. e.g.
* MAIN.PRG
PARAMETERS p_c1, p_c2


If pcount() > 0                && Check for parameters
   IF pcount() >1
       Option2 = p_c2      && Got Both
   ELSE
       Option2 = ""            && Just the first
   ENDIF
   Option1 = p_c1
ELSE                                && Neither
   Option1 = ""
   Option2 = ""
ENDIF

Note: All parameters will come in a strings, and a space will signal the end of a parameter, unless it's inside of quotes ("")

Rick

<richmarin@xxxxxxxxxxxxx> wrote in message news:1130167518.636492.46850@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I am using Foxpro 5.0.

I wanted to start an executible with a parameter. For example,

MyApplication.exe /Monday

So, if the code sees the exe alone. It acts one way, however, if it
sees Monday, the code executes another set of instructions.

I can pass parameters to executibles with Visual Basic. Can I do the
same thing in Foxpro ?

..


.



Relevant Pages

  • Re: On Error GoTo code acting weird
    ... the last command the code executes is the close command. ... If I press the btn I can do it again and again. ... >Private Sub SearchAgainBtn_Click ...
    (microsoft.public.access.formscoding)
  • Re: sendkey method for forms
    ... I assume that clicking Enter causes a command button click. ... I have a sub that calls a form. ... Form executes whatever, required fields are populated ... <code executes the OK> ...
    (microsoft.public.excel.programming)
  • Re: Escape
    ... pressing Esc has different results, depending on what you last did in a ... what do you want to happen when the user clicks the command button? ... > button on a form the code executes the same instance as ...
    (microsoft.public.access.forms)