Abhinit Kumar Das
Abhinit Kumar Das

Reputation: 11

passing parameter to a progress 4gl file using prowin32

I am trying to pass multiple input parameters using prowin32 . But i am not able to find out the correct way of passing multiple parameters.

This is the code of my *.p file

define input parameter param1 as character no-undo.
define input parameter param2 as character no-undo.
message param1 param2 
view-as alert-box.    

and I am trying the below command in proenv

prowin32.exe -p D:\proj\myfolder\sample.p -param "1stValue","SecondValue" -clientlog D:\proj\myfolder\pf\lg.log

I tried removing the quotation marks of the input parameters but I am still getting error saying

mismatched parameters passed to the routine

Upvotes: -1

Views: 196

Answers (3)

DevMgr
DevMgr

Reputation: 41

Another Alternative is to use a Parameter "pf" file .

Prowin32.exe -pf c:\test\myprog.pf

Inside myprog.pf file 
-p c:\test\mystartupProgram.p
-param "Param1, Param2, Param2" 
-db myDB
-H localhost 
-S 5000

Upvotes: 0

FloW
FloW

Reputation: 1266

you cannot parse mulitple parameter in progress just one SESSION:PARAMETER we did it with a own .p file that calls the .p from the session:parameter

prowin32.exe start

prowin32.exe -p D:\proj\myfolder\startpgm.p -param "D:\proj\myfolder\sample.p,1stValue,SecondValue" -clientlog D:\proj\myfolder\pf\lg.lo

startpgm.p

DEFINE VARIABLE hCall AS HANDLE    NO-UNDO.
DEFINE VARIABLE i     AS INTEGER   NO-UNDO.

CREATE CALL hCall.
hCall:CALL-NAME = ENTRY(1,SESSION:PARAMETER). // path
hCall:NUM-PARAMETERS = NUM-ENTRIES(SESSION:PARAMETER) - 1. // Num-Parameter

IF NUM-ENTRIES(SESSION:PARAMETER) > 1 THEN DO:

   DO i = 2 TO NUM-ENTRIES(SESSION:PARAMETER):

      // Parameter
      hCall:SET-PARAMETER(i - 1, "CHARACTER", "INPUT", ENTRY(i,SESSION:PARAMETER)).

   END.

END.

hCall:INVOKE. // Start

Upvotes: 1

Tom Bascom
Tom Bascom

Reputation: 14020

Use -param “1stValue,2ndValue”.

In your code you then use:

P1 = entry( 1, session:parameter ).
P2 = entry( 2, session:parameter ).

Rather than the “define input parameter…” statements.

Upvotes: 3

Related Questions