Page 1 of 1

adding parameters to a command line to launch a local URL

Posted: Thu Apr 23, 2020 3:54 pm
by Rick Lipkin
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

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

Posted: Thu Apr 23, 2020 6:37 pm
by cnavarro
Rick, try with
File:\\c:\fox\doi\leavtrav\leavew32.exe?projectid=12345

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

Posted: Thu Apr 23, 2020 7:10 pm
by Rick Lipkin
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

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

Posted: Fri Apr 24, 2020 1:15 pm
by Rick Lipkin
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

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

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

Posted: Fri Apr 24, 2020 2:44 pm
by Antonio Linares
Rick,

Code: Select all

function Main( ... )

   ? hb_AParams()

return nil
live demo:
https://fivetechsoft.github.io/snippets?20200424144640

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

Posted: Fri Apr 24, 2020 5:32 pm
by Rick Lipkin
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

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

Posted: Mon Apr 27, 2020 2:47 pm
by Rick Lipkin
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

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