FUNCNAME$ function

Purpose | Return the name of the current Sub/ Function/ Method/ Property.
Syntax | f$ = FUNCNAME$

Remarks

FUNCNAME$ returns the name of the procedure in which it is located. If an ALAIS is specified, FUNCNAME$ returns the ALIAS name; otherwise, it returns the primary name capitalized. Returning the ALIAS name provides a mechanism to disguise sensitive internal procedure names even when reporting error conditions to a user.

FUNCNAME$ can be useful as a debugging tool, or in situations where an error handler in a procedure passes error information on to a "central" procedure for logging and handling. FUNCNAME$ does not require #TOOLS ON.

See also | #TOOLS, CALLSTK, CALLSTK$, CALLSTKCOUNT, FILENAME$, FUNCTION, METHOD, PROFILE, PROPERTY, SUB, TRACE

Example

SUB SecretEncryptionSub ALIAS "MySub" (sData$)

x$ = FUNCNAME$ ' Returns "MySub"

END SUB

[statements]

SUB SecretDecryptionSub (sData$)

x$ = FUNCNAME$ ' Returns "SECRETDECRYPTIONSUB"

END SUB