[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 PROCNAME()
 Return the name of the current or previous procedure or user-defined function
------------------------------------------------------------------------------
 Syntax

     PROCNAME([<nActivation>]) --> cProcedureName

 Arguments

     <nActivation> specifies which activation to query.  A value of zero
     refers to the current activation, a value of one refers to the previous
     activation, etc.  If unspecified, the default value is zero.

 Returns

     PROCNAME() returns the name of a currently executing procedure,
     function, or code block, as a character string.

 Description

     PROCNAME() queries the CA-Clipper activation stack to determine the name
     of a currently executing procedure, user-defined function, or code
     block.  The activation stack is an internal structure that maintains a
     record of each procedure, function, or code block invocation.

     For the current activation, PROCNAME() returns the name of the current
     procedure or user-defined function.  For a previous activation,
     PROCNAME() returns the name of the procedure or user-defined function
     that invoked the current procedure.

     If the activation being queried is a code block evaluation, PROCNAME()
     returns the name of the procedure or user-defined function that defined
     the code block, preceded by "b".  If the activation being queried is a
     memvar, PROCNAME() returns the name preceded by "M->".

     PROCNAME() is used with PROCLINE() to report debugging information.

 Examples

     .  This example is a user-defined function you can call during a
        debugging phase of program development in order to display the
        activation stack with line numbers:

        FUNCTION ListStack( cMessage )
           LOCAL nActivation := 1
           ? cMessage
           DO WHILE !(PROCNAME(nActivation) == "")
              ? "Called from:", PROCNAME(nActivation),;
                 "(" + LTRIM(STR(PROCLINE(nActivation))) + ")"
              nActivation++
           ENDDO
           QUIT
           RETURN NIL

 Files   Library is CLIPPER.LIB.


See Also: PROCLINE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson