Consultor Eletrônico



Kbase P11958: How to get the Program Stack of a Progress Session
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/12/2009
Status: Verified

GOAL:

How to get the Program Stack of a Progress Session

GOAL:

How to use program-name function to get the stack of programs called

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

PROGRAM-NAME: Returns the name of the calling program.

EXAMPLE

This procedure returns the names of any procedure(s) that called it, and displays the number of levels that the procedure was nested.


/* Note this program should be run as a subroutine */
/* The deeper the nesting, the better the illustration */

DEFINE VAR level AS INT INITIAL 1.

REPEAT WHILE PROGRAM-NAME(level) <> ?.

DISPLAY LEVEL PROGRAM-NAME(level) FORMAT "x(30)".

level = level + 1.

END.


NOTE: See the documentation for information about what the function returns depending on from where it is called.