Focal Point
[CLOSED] Calling a maintain procedure

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3867025966

March 10, 2014, 09:04 AM
Tim P.
[CLOSED] Calling a maintain procedure
Hey,
I have two maintain procedures I created in one project. One contains a form that is a welcome screen that calls forms in the second procedure. I imported the forms in the second procedure into the first but when i try to compile the main procedure that holds that welcome screen it says it can't find a case function that sits in the second procedure.

I placed a call function into the first procedure to call the second procedure but that didn't solve it either.

Anyone know the proper way to call a maintain procedure from another procedure?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
March 10, 2014, 12:43 PM
John_Edwards
A little confused -- have you put everything into the one Maintain file, or are you calling one Maintain file from another?

J.



March 10, 2014, 01:04 PM
Maintain Wizard
Tim
There are a couple of way to do this. The first is to have a single Maintain application with multiple cases and functions. A single Maintain can contain multiple forms.

From your welcome screen, you can have a button that just does a WINFORM SHOW form2 and that will display another form. Or you can have PERFORM function. Here, your function would do whatever calculations it needs and then do a WINFORM SHOW form.

If you want to have separate Maintain procedures, you need to use the CALL command.

In your first procedure, with the Welcome form, you would perform a case containing the command CALL maintain procedure, and that would launch the second Maintain procedure and go from there. Then in the second Maintain you would have a Winform Show command to show the next form.

If you have questions, you can send me an e-mail at Mark_Derwin@IBI.Com.

Mark
March 10, 2014, 01:49 PM
Tim P.
I am calling one maintain file from another. I placed a CALL command into the 'TOP' of the first maintain file which I would think would call the second maintain file on load but it does not.


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
March 10, 2014, 02:24 PM
Maintain Wizard
Tim
When Maintain reaches the CALL command it will pass control to the second Maintain procedure. The syntax is:
CALL MAINTAIN_PROCEDURE FROM variables INTO variables.

Control stays with the second Maintain until it ends. The control is passed back to the calling or Parent Maintain, just after the CALL command.

If this is not working please post your code, or zip up the project and send it to me at Mark_Derwin@IBI.com.

Mark
March 10, 2014, 02:37 PM
Tim P.
Correct thats how i thought it worked:

Case Top
Call tek_rls_exception;
Winform Show Welcome_screen; 
EndCase  


This is the code from the first maintain procedure.

'tek_rls_exception' is the name of the second procedure. 'tek_rls_exception' contains 2 forms that I have imported into the first maintain procedure. I figured if i called the second procedure like I did above, it would work.


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
March 11, 2014, 07:39 AM
Maintain Wizard
Tim
If you just run tek_rls_exception does it work? The forms for tek_rls_exception should be in the first Maintain but in the child or called Maintain.

What are you doing in tek_rls_exception? When the top case runs, control is passed to tek_rls_exception and will stay there until that Maintain ends.

Mark