C5_PROCNAME

 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 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()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.