Thiru
Thiru

Reputation: 251

Is that possible to call window procedure from another window trigger section?

I want to write a program for call window procedure from another window trigger section.Let me share my program what i have tried.

DO:
  DEFINE VARIABLE cPartType     AS CHARACTER NO-UNDO.
  DEFINE VARIABLE cSubPartType  AS CHARACTER NO-UNDO.
  DEFINE VARIABLE cAttributeExp AS CHARACTER NO-UNDO.
  DEFINE VARIABLE cOutputQty    AS CHARACTER NO-UNDO.
  DEFINE VARIABLE cOutputExp    AS CHARACTER NO-UNDO.
  DEFINE VARIABLE  cResult      AS CHARACTER NO-UNDO.
  DEFINE VARIABLE  cCheckCase   AS CHARACTER NO-UNDO.

  ASSIGN
  cPartType     = coCombo  :SCREEN-VALUE IN FRAME {&FRAME-NAME}  
  cSubPartType  = fiChar-2 :SCREEN-VALUE IN FRAME {&FRAME-NAME} 
  cAttributeExp = fiChar-3 :SCREEN-VALUE IN FRAME {&FRAME-NAME}
  cOutputQty    = fiChar-4 :SCREEN-VALUE IN FRAME {&FRAME-NAME} 
  cOutputExp    = fiChar-5 :SCREEN-VALUE IN FRAME {&FRAME-NAME}.

  { launch.i   &PLIP        = "'ford/prc/Parts.p'"  
                     &IProc       = "'AddPart'"
                     &PList       = "(INPUT cPartType,
                                      INPUT cSubPartType,
                                      INPUT cAttributeExp,
                                      INPUT cOutputQty,
                                      INPUT cOutputExp,
                                      OUTPUT cResult,
                                      OUTPUT cCheckCase)"
                     &AutoKill    =  YES
                     &OnApp       = 'YES'
                     &PARTITION   = 'ASS'                                                                                                   
   }

END.

Here I can call the procedure from plipp file but i want to call another window procedure from this trigger. Could you help this case?

Upvotes: 0

Views: 414

Answers (1)

bupereira
bupereira

Reputation: 1498

If the procedure is in the same program, then just

RUN addPart  (INPUT cPartType,
                           INPUT cSubPartType,
                           INPUT cAttributeExp,
                           INPUT cOutputQty,
                           INPUT cOutputExp,
                           OUTPUT cResult,
                           OUTPUT cCheckCase).

Now if that procedure lives in a different program, you'll need a handle to it to run. In that case, in the definitions define a handle variable like this

DEFINE VARIABLE myHandle AS HANDLE NO-UNDO.

And in the main block add this code

RUN ford/prc/Parts.p PERSISTENT SET myHandle.

Finally, in the trigger, do a

RUN addPart IN myHandle (INPUT cPartType,
                           INPUT cSubPartType,
                           INPUT cAttributeExp,
                           INPUT cOutputQty,
                           INPUT cOutputExp,
                           OUTPUT cResult,
                           OUTPUT cCheckCase).

Upvotes: 1

Related Questions