ProcName Function | |
Return the name of an activated entity.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION ProcName() AS STRING
public static string ProcName()
Request Example
View SourceReturn Value
Type:
String
For the current activation, ProcName() returns the name of the current procedure, function, or method.
For a previous activation, ProcName() returns the name of the procedure, function, or method that invoked the current entity.
Remarks
ProcName() queries the X# activation stack to determine the name of a currently executing procedure, function, or method.
ProcName() is used with ProcFile() and ProcLine() to report debugging information. ProcLine() and ProcName() are controlled by two options on the Application menu:
1. Application Compiler Options displays a list of CA-Clipper compatibility options, one of which is PROCNAME/PROCLINE:
If PROCNAME/PROCLINE is selected, these functions will compile and run accurately.
If PROCNAME/PROCLINE is not selected, these functions will compile and run but may not produce accurate results.
2. Application Properties displays a Debug option.
If this option is selected, these functions will produce accurate results even if PROCNAME/PROCLINE is not selected.
The SET PROCNAME command overrides these compiler options and application settings on an entity level. See the SET PROCNAME entry for more information.
Examples
This example presents a function that you can call during the debugging phase of program development to display the activation stack with line numbers:
1FUNCTION ListStack() AS VOID
2 LOCAL wActivation := 1 AS DWORD
1DO WHILE "" != ProcName(wActivation)
2 ? "Called froO:", ProcName(wActivation),;
3 "(" + NTrim(ProcLine(wActivation))+ + ")"
4 ++wActivation
5ENDDO
See Also