-pf -p wMain.w (INPUT "abc")????

BrianSmith

New Member
Is it possible to pass a parameter to a program from within a parameter file?
My pf file has the entry '-p wMain.w' and I would like to be able to pass a parameter to wMain.w, such as -p wMain.w (INPUT "parm1"), but this does not seem to work, I get the error message 'could not recognize argument (301)'. wMain.w does have an input parameter defined. The problems seems to be with the pf file.
 
BrianSmith said:
Is it possible to pass a parameter to a program from within a parameter file?
My pf file has the entry '-p wMain.w' and I would like to be able to pass a parameter to wMain.w, such as -p wMain.w (INPUT "parm1"), but this does not seem to work, I get the error message 'could not recognize argument (301)'. wMain.w does have an input parameter defined. The problems seems to be with the pf file.
You can not invoke "input parameters" in a startup procedure.

Look at the -param startup option though. You can do something like this.

#my.pf
-param "value-1, value-2"
-p wMain.w

/*wMain.w*/

DEFINE VARIABLE v-1 AS CHARACTER NO-UNDO.
DEFINE VARIABLE v-2 AS CHARACTER NO-UNDO.
DEFINE VARIABLE v-int AS INTEGER NO-UNDO.
define button b-close.
v-1 = entry(1,session:parameter).
v-2 = entry(2,session:parameter).
display
v-1
skip
v-2
skip(3)
b-close with frame a.

ON 'choose':U OF b-close in frame a
DO:
apply "close" to this-procedure.
quit.
END.
enable all with frame a.
wait-for close of this-procedure.

#######
If you exit into the Progress editor you will get an error message, because -param is also used to load files into procedure editor buffers.
 
Back
Top