adding parameters to a command line to launch a local URL

adding parameters to a command line to launch a local URL

Postby Rick Lipkin » Thu Apr 23, 2020 3:54 pm

To All

I wish to create a local URL that will launch from an HTML e-mail like Outlook or from a document in Word .. I am testing this on my local machine in Word .. I want to add a /parameter to the end of the command line so I can trap it with the PARAMETERS statement.

PARAMETERS xTEXT line in my code .. unfortunately I can not find the correct syntax to to this ..

This works on my local drive to start the program ...

File:\\c:\fox\doi\leavtrav\leavew32.exe <-- this works

How can I add a /parameter to the end of the above File:\\URL and have it be a part of the command line

File:\\c:\fox\doi\leavtrav\leavew32.exe /projectid=12345

The above line only launches the program and does not pass the /project=12345 ..

What am I missing ??? quotations ??

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Postby cnavarro » Thu Apr 23, 2020 6:37 pm

Rick, try with
File:\\c:\fox\doi\leavtrav\leavew32.exe?projectid=12345
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: adding parameters to a command line to launch a local URL

Postby Rick Lipkin » Thu Apr 23, 2020 7:10 pm

Cristobol

Unfortunately that did not work PARAMETERS returned nil .. I tried it this way too File:\\c:\fox\doi\leavtrav\leavew32.exe%020/projectid=12345 ..

Rick
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Postby Rick Lipkin » Fri Apr 24, 2020 1:15 pm

To All

If I create this link \\sales\saliteprod\Leavew32.exe "Rick Lipkin" and run it in Windows Run

Image

my program returns

Image

Here is the code at the top of my program

Code: Select all  Expand view

PARAMETERS xText
 


xText returns the command line parameters ... So if you can run the above script ( unc ) in the Windows Run command you should be able click on the link and pass the parameter .. instead of the Windows Run..

I would appreciate any input!

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Postby Antonio Linares » Fri Apr 24, 2020 2:44 pm

Rick,

Code: Select all  Expand view
function Main( ... )

   ? hb_AParams()

return nil

live demo:
https://fivetechsoft.github.io/snippets?20200424144640
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41397
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: adding parameters to a command line to launch a local URL

Postby Rick Lipkin » Fri Apr 24, 2020 5:32 pm

Antonio

Thanks for your quick reply ... I am not having problems with extracting the parameters when you cut and paste the entire link into the Windows Run dialog . I just can not get the parameters to resolve when the link is clicked. .. The executable starts and runs, but does not resolve the parameters .. has to be a syntax to make this work from a click rather than cut and paste.

\\sales\saliteprod\Leavew32.exe "Rick Lipkin"



Thanks
Rick
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: adding parameters to a command line to launch a local URL

Postby Rick Lipkin » Mon Apr 27, 2020 2:47 pm

Antonio

I am trying get your suggestion to work by using the function hb_Aparams() .. and as you know it creates an array ... and I have not been successful is evaluating the array

Leavew32 "Rick Lipkin"

Using the above example from the command line ...

Code: Select all  Expand view

Local aParams,nParamNo

aParams := {}
aParams :=  hb_AParams()

FOR nParamNo := 1 TO LEN( aParams )
   ? nParamNo, aParams[ nParamNo ]
NEXT

 


The above code returns the number 1 .. and not the value of the array element .. I am looking to the result of "Rick Lipkin" .. which was the value of the command line .. appreciate your Help.

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 30 guests

cron