&CLASS | Class short name. Blank if you want to run a method of the same class. |
&CLASSTYPE | class type of the called class |
&PARAMETERS | Parameter list for the method call, excluding (). |
&PROCEDURE | Name of the method to call. |
&USER-DEFINED-CONTEXT |
&if "{&CLASS}" = "" &then /* run method in own class */ &if "{&PARAMETERS}" = "" &then run {&PROCEDURE} in {&TARGETPROCEDURE}. &else run {&PROCEDURE} in {&TARGETPROCEDURE} ({&PARAMETERS}). &endif &elseif "{&CLASS-REF}" = "" &then &if defined(vh{&CLASS}Inst) &then /* run method in instance of referenced class */ &if "{&PARAMETERS}" = "" &then run {&PROCEDURE} in vh{&CLASS}Inst. &else run {&PROCEDURE} in vh{&CLASS}Inst ({&PARAMETERS}). &endif &elseif "{&CLASSTYPE}" = "T" &then /* run method in a technical class, using a generic handle */ &if "{&PARAMETERS}" = "" &then run {&PROCEDURE} in vhFcComponent. &else run {&PROCEDURE} in vhFcComponent ({&PARAMETERS}). &endif &else /* Run method in a business class without reference, using a generic handle. class must be started and stopped here. */ if vhFcComponent = ? then do: assign viFcCount1 = 0 vlFcStarted = yes. run value(lc("ins/ins__{&CLASS}.p":U)) persistent set vhFcComponent. run MainBlock in vhFcComponent (input viSessionId, input 0, input ?, input no, input "{&USER-DEFINED-CONTEXT}", input-output viFcCount1, output viFcIncludeReturn). if viFcIncludeReturn < 0 then do: assign oiReturnStatus = viFcIncludeReturn. run StopInstance in vhFcComponent (input "", input "", input "", input no, output viFcIncludeReturn). delete procedure vhFcComponent. return ?. end. end. else vlFcStarted = no. &if "{&PARAMETERS}" = "" &then run {&PROCEDURE} in vhFcComponent. &else run {&PROCEDURE} in vhFcComponent ({&PARAMETERS}). &endif if vlFcStarted then do: run StopInstance in vhFcComponent (input "", input "", input "", input no, output viFcIncludeReturn). delete procedure vhFcComponent. if viFcIncludeReturn < 0 then do: assign oiReturnStatus = viFcIncludeReturn. return ?. end. end. &endif &else /* run method in instance of referenced class */ &if "{&PARAMETERS}" = "" &then run {&PROCEDURE} in vh{&CLASS-REF}Inst. &else run {&PROCEDURE} in vh{&CLASS-REF}Inst ({&PARAMETERS}). &endif &endif