Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I send a parameter to main program?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00184098
Message ID:
00184221
Vues:
19
>I may be going about this all wrong...
>
>I have recently purchased SDT and I wanted to put in my main prg code that if a parameter is passed that I run the needupdate and update methods.
>
>I put a lparameter statement in my main program and from my development environment I can issue "do lsmain with "U"" and everything works great...Is there a way to do this from my clients site that has an executable. For example, LS.EXE -U?
>
>Thanks,
>Paul

Lets say you have created a shortcut to this application on the client's desktop.

Right click this and select "Properties". Select the "Shortcut" tab and in the text box "Target:" you will find the path to youe exe...

"c:\myapps\vfpapp\mybigapp.exe" without the quotes.

Type a space after this and type "U".

When the icon is clicked, "U" is passed to the VFP app provided the Startup MAIN program has a Parameter statement.

Remember that you can ONLY pass Strings in this way. You can pass as many parameters as VFP will allow providing:

1.You separate them with 1 space
2. You have an equal number of parameters in the vfp app.

So the line could look like:

c:\myapps\vfpapp\mybigapp.exe "U" (exactly like this with the U in quotes!)

c:\myapps\vfpapp\mybigapp.exe "T" "BULLSHIT","{12/12/1998}"

Will pass three params to vfp. It is now up to you to convert the "T" to a .T. to a .F. and the "{12/12/1998}" to a date using CTOD(param3)etc.

Hope this helps
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform