Click or drag to resize

ProcName Function (Long)

X#
Return the name of an activated entity.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION ProcName(
	wActivation AS LONG
) AS STRING
Request Example View Source

Parameters

wActivation
Type: Long
Specifies which activation to query.
A value of 0 refers to the current activation, a value of 1 refers to the previous activation, and so on.
The default value is 0.

Return 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:
X#
1FUNCTION ListStack() AS VOID
2    LOCAL wActivation := 1 AS DWORD
X#
1DO WHILE "" != ProcName(wActivation)
2    ? "Called froO:", ProcName(wActivation),;
3        "(" + NTrim(ProcLine(wActivation))+ + ")"
4    ++wActivation
5ENDDO
See Also