Click or drag to resize

ProcLine Function (DWord)

X#
Return the source line number of the last line executed in an activated entity.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION ProcLine(
	dwActivation AS DWORD
) AS DWORD
Request Example View Source

Parameters

dwActivation
Type: DWord
Specifies which activation to query. 0 refers to the current activation, 1 refers to the previous activation, and so on.
The default value is 0.

Return Value

Type: DWord
For the current activation, ProcLine() returns the number of the current line.
For a previous activation, ProcLine() returns the number of the line that invoked the procedure, function, or method in which ProcLine() is invoked. Since X# is not file-based, the line number is relative to the beginning of the activated entity and not relative to the beginning of the source file containing the entity.
A line can include a comment, a blank line, a user defined command, or a continued line.
A multistatement line is counted as a single line.
Remarks
ProcLine() queries the X# activation stack to determine the last line executed in a currently executing procedure, function, or method. ProcLine() is used with ProcFile() and ProcName() 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 PROCLINE command overrides these compiler options and application settings on an entity level. See the SET PROCLINE entry for more information.
Examples
This example presents a function that you can call during the debugging phase of program development to display part of the activation stack with line numbers:
X#
1FUNCTION Start()
2    ? "Running"
3    MyFunction()
4FUNCTION MyFunction() AS VOID
5    ? ProcLine()        // 2 (line in current function)
6    ? ProcLine(1)        // 3 (line in previous function)
See Also