Consultor Eletrônico



Kbase P122881: Does RUN VALUE(...) see what is passed to VALUE(...) as a program and a list of parameters?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/03/2007
Status: Unverified

GOAL:

Does RUN VALUE(...) see what is passed to VALUE(...) as a program and a list of parameters?

GOAL:

Can I pass a parameter list to the RUN statement by using RUN VALUE()?

GOAL:

Progress 9.1x

GOAL:

OpenEdge 10.x

FIX:

The VALUE() phrase of the RUN statement interprets what is passed to it as the name of the ABL program to run. It does not do any interpreting of what is passed to it to see if there are any parameters so consequently it is not possible to do something like this...

DEFINE VARIABLE cString AS CHARACTER NO-UNDO.

ASSIGN cString = 'X.P (OUTPUT SomeVariable)'.

RUN VALUE(cString).

If you need to dynamically define the parameter list for a program you may want to consider using the CREATE CALL statement. For example...

DEFINE VARIABLE hCall AS HANDLE NO-UNDO.
DEFINE VARIABLE cSomeVariable AS CHARACTER NO-UNDO.

CREATE CALL hCall.

hCall:CALL-NAME = "X.P".
hCall:NUM-PARAMETERS = 1.
hCall:SET-PARAMETER(1, "CHARACTER", "OUTPUT", cSomeVariable).

hCall:INVOKE.

DELETE OBJECT hCall.