Try OpenEdge Now
skip to main content
Dynamic Call Object
Code examples : Running an internal procedure of a single-run or singleton procedure
 

Running an internal procedure of a single-run or singleton procedure

The following example shows how to dynamically invoke a procedure as single-run and then dynamically invoke an internal procedure of the single-run. The same syntax can be used to call a procedure as persistent or singleton by setting PROCEDURE-TYPE to "PERSISTENT" or "SINGLETON", respectively.
DEFINE VARIABLE hCall AS HANDLE NO-UNDO.

CREATE CALL hCall.

/* Invoke single.p as single-run*/
ASSIGN
  hCall:CALL-NAME  = "single.p"
  /* Sets CALL-TYPE to the default */
  hCall:CALL-TYPE  = PROCEDURE-CALL-TYPE
  hCall:PROCEDURE-TYPE = SINGLE-RUN.

hCall:INVOKE.

/* Invoke internal-single-proc in single.p */

ASSIGN
  hCall:CALL-NAME      = "internal-single-proc"
  /* Sets CALL-TYPE to the default */
  hCall:CALL-TYPE      = PROCEDURE-CALL-TYPE
  hCall:NUM-PARAMETERS = 1.

hCall:SET-PARAMETER(1, "INTEGER", "INPUT", 333).
hCall:INVOKE( ).

/* Clean up */
DELETE PROCEDURE hCall:IN-HANDLE.
DELETE OBJECT hCall.