Syntax
ProcName( [nLevel] ) --> cNameArguments
nLevel
is the number of steps up the call stack. 0, the default, is the current routine, 1 is the routine that called it, and so on.
Return value
The routine name as an uppercase string, or "" when nLevel is above the first routine of the program.
Description
Without an argument, the compiler supplies the name of the routine that contains the call. With nLevel, the name is read from the call stack at run time. A method is named CLASS:METHOD.
Notes
The example prints "MAIN" and "S_SHOWNAME".
Example
PROCEDURE Main()
QOut( ProcName() )
s_ShowName()
RETURN
STATIC PROCEDURE s_ShowName()
QOut( ProcName() )
RETURNOutput
MAIN
S_SHOWNAME