Click or drag to resize

ProcFile Function (Long)

X#
Return the name of the activated module.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION ProcFile(
	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, ProcFile() returns the name of the current module.
For a previous activation, ProcFile() returns the name of the module that invoked the current module.
Remarks
ProcFile() queries the X# activation stack to determine the name of the currently executing module. ProcFile() is used with ProcLine() and ProcName() to report debugging information. Not every function call sets up the activation stack.
A function invokes the activation stack if in it you have used PRIVATE or PUBLIC variables or issued a SET PROCNAME ON command.
Examples
This example presents a function that you can call during the debugging phase of program development to display the names of the current and previously activated modules:
X#
1// In Module1:
2FUNCTION Start()
3    MyFunction()
4// In Module2:
5FUNCTION MyFunction() AS VOID
6    ? ProcFile()            // Module2 (current)
7    ? ProcFile(1)            // Module1 (previous)
See Also