Running App out of Another App (Appbuilder)

Phillip

Member
I'm trying to run an app out of another app - both built using AppBuilder. What I want to do is have the user click a button that would load another app similar to a pop up window where they would load job data through some barcode validation processes I setup, click a button, and the data would be passed as variables back to the previous app to load into their respective fields.

I setup a button that had the process of "run shipverify.w" but when I run it there is an error that says it needs to be run persistent or something similar to that. Can anyone please help?

Thanks.
 

Cringer

ProgressTalk.com Moderator
Staff member
run shipverify.w persistent set lv-handle.
That should see you right.
 

Phillip

Member
run shipverify.w persistent set lv-handle.
That should see you right.

What do I define lv-handle as? I'm new to App Builder so please excuse any simple fixes that I don't know.

Also, I've run .p files before with inputs and outputs, however, is this the same process to get outputs from .w files? Or would I define a global variable to match up between apps?
 

Osborne

Active Member
You can use inputs and outputs with .w files, but there are slight differences if they are run as persistent.

A very basic example:
Code:
/* Prog1.w */
DEF VAR lv-handle AS HANDLE NO-UNDO.

ON CHOOSE OF bShipVerify IN FRAME Frame1 DO:
   IF NOT VALID-HANDLE(lv-handle) THEN
      RUN shipverify.w PERSISTENT SET lv-handle (INPUT THIS-PROCEDURE).
   RUN InternalProcedure1 IN lv-handle (INPUT param1, INPUT param2).
END.

PROCEDURE shipVerified:
  DEFINE INPUT PARAMETER pVerified AS LOGICAL NO-UNDO.
  ...
END PROCEDURE.

/* shipverify.w */
DEF INPUT PARAMETER pCallingProg AS HANDLE NO-UNDO.

PROCEDURE InternalProcedure1:
   DEFINE INPUT PARAMETER pParam1 AS CHARACTER NO-UNDO.
   DEFINE INPUT PARAMETER pParam2 AS CHARACTER NO-UNDO.
   ...
END PROCEDURE.

PROCEDURE InternalProcedure2:
   ...
   RUN shipVerified IN pCallingProg (INPUT pVerified).
END PROCEDURE.
 

Cringer

ProgressTalk.com Moderator
Staff member
You'll also probably want to ensure that when you close prog1.w that you also clean up shipverify.w, and any associated handles.
 
Top