xHarbour Reference Documentation > Function Reference |
Determines the current line number executed in a PRG source code file.
ProcLine( [<nCallStack>] ) --> nPrgLineNumber
The function returns a numeric value indicating the line number in the PRG source code file that is currently being executed. If <nCallStack> is larger than the number of entries in the call stack, or if the executable is created with the /l compiler switch, the return value is zero.
ProcLine() is a debug function used to determine the line in the PRG source code file that is currently being executed. It is mainly used in conjunction with error handling routines that identify the location of runtime errors. See function ErrorBlock() for a discussion of error handling.
See also: | ErrorBlock(), ProcFile(), ProcName() |
Category: | Debug functions |
Source: | vm\proc.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example implements a user defined function that collects call stack // information in an array. FUNCTION GetCallStack() LOCAL aStack := {} LOCAL nStack := 1 // Skip the GetCallStack() function in the result DO WHILE .NOT. Empty( ProcName(nStack) ) AAdd( aStack, { ProcFile(nStack), ProcName(nStack), ProcLine(nStack) } nStack ++ ENDDO RETURN aStack
http://www.xHarbour.com