Consultor Eletrônico



Kbase P88141: How to find the startup procedure of a Progress session ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/3/2004
Status: Unverified

GOAL:

How to find the startup procedure of a Progress session ?

GOAL:

How to obtain a session's startup procedure ?

GOAL:

How to retrieve the value for the -p parameter ?

FIX:

As the startup procedure for a session will always be located at the bottom of the procedure stack, it can be retrieved by looping through the stack with the PROGRAM-NAME function.

Example:

DEFINE VARIABLE iLoop    AS INTEGER    NO-UNDO.
DEFINE VARIABLE cStartup AS CHARACTER  NO-UNDO.

REPEAT :
   iLoop = iLoop + 1.
   IF PROGRAM-NAME(iLoop) = ? THEN LEAVE.
   cStartup = PROGRAM-NAME(iLoop).
END.

MESSAGE cStartup
   VIEW-AS ALERT-BOX INFO BUTTONS OK.

Note that if the session drops to the Procedure Editor after completing the startup procedure (or if no startup procedure was specified), this will return "_edit.p"