Consultor Eletrônico



Kbase P122176: How to pass parameters when using the VALUE() option of the RUN statement?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/02/2007
Status: Unverified

GOAL:

How to pass parameters when using the VALUE() option of the RUN statement?

GOAL:

Can the parameters of a RUN VALUE() statement be passed inside of a variable?

FIX:

No, the parameters of a RUN VALUE() statement can not be passed inside of a variable. Thus executing the code:
DEFINE VARIABLE cProgramName as CHARACTER NO-UNDO.
DEFINE VARIABLE cParameterList as CHARACTER NO-UNDO.

ASSIGN cProgramName = "callee.p"
cParameterList = "(7, 9)".
RUN VALUE(cProgramName) + value(cParameterList).

would generate the error "Mismatched number of parameters passed to routine <name>. (3234)".
The syntax for passing the parameters of the RUN VALUE() statement in exactly the same as that of the RUN statement without the VALUE() option. In other words, the syntax for passing parameters is to explicitly enumerate the parameters, enclosed in parenthesis, at the end of the RUN statement regardless whether we use the VALUE() option or not. For example:
1. Without using the VALUE() option:
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE j AS INTEGER NO-UNDO.
RUN Calee.p(INPUT i, OUTPUT j).
2. With the VALUE() option:
DEFINE VARIABLE cProgramName AS CHARACTER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE j AS INTEGER NO-UNDO.
ASSIGN
cProgramName = "Callee.p".
RUN VALUE(cProgramName)(INPUT i, OUTPUT j).