Kbase 19124: How To Pass Parameters From The Command Line ( -param )
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  25/01/2008 |
|
Status: Verified
GOAL:
How to use the -param Session Parameter with a list of entries?
GOAL:
Session Parameter -param and entry list
GOAL:
Using the -param parameter to refer to a list of values
GOAL:
Passing a single character string with -param
GOAL:
Passing a parameter containing spaces with -param
GOAL:
Converting the character parameter to another datatype with -param
GOAL:
How to pass parameters from the command line (using -param ) to 4GL
GOAL:
This technique can be used to pass parameters to a Progress application that needs to behave differently based on some few parameters, or batch programs that needs parameters.
GOAL:
How to use -param?
GOAL:
Can a startup procedure have parameters?
GOAL:
How to deal with -param value in the code?
GOAL:
What is the -param startup option?
GOAL:
How to pass parameters from the command line ( -param )
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
This Solution describes how to pass parameters to Progress from the command line to a 4GL program.
This technique can be used to pass parameters to a Progress application that needs to behave differently based on some few parameters, or batch programs that needs parameters.
The -param parameter can be used to pass a character string to a Progress session.
The SESSION:PARAMETER attribute can be used to access this character string.
This character string can be converted to another data type or parser as required by the application.
The -param parameter can be used with any Progress client, examples:
- prowin32 -p pp.p -param test
- _progres -p pp.p -param test
- pro -p pp.p -param test
- mpro -p pp.p -param test
- bpro -p pp.p -param test
- mbpro -p pp.p -param test
Example of usages:
1) Passing a single character string:
- prowin32 -p pp.p -param test
- Test program (pp1.p)
DISPLAY "The parameter is:" SKIP SESSION:PARAMETER FORMAT "X(70)".
PAUSE.
QUIT.
2) Passing a parameter containing spaces:
- prowin32 -p pp1.p -param "test abc"
- Test program (pp.p)
DISPLAY "The parameter is:" SKIP SESSION:PARAMETER FORMAT "X(70)".
PAUSE.
QUIT.
3) Converting the character parameter to another datatype
- prowin32 -p pp1.p -param 1024
- Test program (pp.p)
DISPLAY "The result of the parameter + 70 is:" SKIP
INTEGER(SESSION:PARAMETER) + 70.
PAUSE.
QUIT.
4) Using the -param parameter to refer to a list of values
- prowin32 -p pp1.p -param abc,xyz,123,789
- Test program (pp.p)
DEF VAR c AS CHAR.
DEF VAR i AS INT.
c = SESSION:PARAMETER.
DISPLAY "The parameter is:" SKIP
c FORMAT "X(70)" SKIP
"The number of entries is:" NUM-ENTRIES(c).
REPEAT i = 1 TO NUM-ENTRIES(c):
DISPLAY "Entry: " I " is " ENTRY(I, c).
END.
PAUSE.
QUIT.