Consultor Eletrônico



Kbase P23252: How to start a super procedure outside the ADM2
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

How to start a super procedure outside the ADM2

FIX:

You can use the same code as ADM2 procedure "start-super-proc":

PROCEDURE start-super-proc :
/*------------------------------------------------------------------------------
Purpose: Procedure to start a super proc if it's not already running,
and to add it as a super proc in any case.
Parameters: Procedure name to make super.
Notes: NOTE: This presumes that we want only one copy of an ADM
super procedure running per session, meaning that they are
stateless and "multi-threaded". This is intended to be the case
for ours, but may not be true for all super procs.
------------------------------------------------------------------------------*/

DEFINE INPUT PARAMETER pcProcName AS CHARACTER NO-UNDO.
DEFINE VARIABLE hProc AS HANDLE NO-UNDO.

hProc = SESSION:FIRST-PROCEDURE.
DO WHILE VALID-HANDLE(hProc) AND hProc:FILE-NAME NE pcProcName:
hProc = hProc:NEXT-SIBLING.
END.
IF NOT VALID-HANDLE(hProc) THEN
RUN VALUE(pcProcName) PERSISTENT SET hProc.
THIS-PROCEDURE:ADD-SUPER-PROCEDURE(hProc, SEARCH-TARGET).

RETURN.

END PROCEDURE.