Return the source line number of the last line executed in an activated entity.
XSharp.Core (in XSharp.Core.dll) Version: 2.16
Syntax Request Example
FUNCTION ProcLine() AS DWORD
public static uint ProcLine()
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.
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.
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:
2 ? "Running"
4FUNCTION MyFunction() AS VOID
5 ? ProcLine()
6 ? ProcLine(1)