FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour adding parameters to a command line to launch a local URL
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
adding parameters to a command line to launch a local URL
Posted: Thu Apr 23, 2020 03: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

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: adding parameters to a command line to launch a local URL
Posted: Thu Apr 23, 2020 06: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
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: adding parameters to a command line to launch a local URL
Posted: Thu Apr 23, 2020 07: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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: adding parameters to a command line to launch a local URL
Posted: Fri Apr 24, 2020 01:15 PM
To All

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



my program returns



Here is the code at the top of my program

Code (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: adding parameters to a command line to launch a local URL
Posted: Fri Apr 24, 2020 02:44 PM
Rick,

Code (fw): Select all Collapse
function Main( ... )

   ? hb_AParams()

return nil

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

Antonio Linares
www.fivetechsoft.com
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: adding parameters to a command line to launch a local URL
Posted: Fri Apr 24, 2020 05: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

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: adding parameters to a command line to launch a local URL
Posted: Mon Apr 27, 2020 02: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 (fw): Select all Collapse
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

Continue the discussion