xHarbour Reference Documentation > Function Reference |
Determines the current PRG source code file.
ProcFile( [<nCallStack>] ) --> cPrgFilename
The function returns a character string holding the name of the PRG file in which the queried routine is implemented. If <nCallStack> is larger than the number of entries in the call stack, or if the file name is not included as debug information in the linked executable file, an empty string is returned ("").
ProcFile() is a debug function used to determine the PRG file name in which a routine activated in the call stack is implemented. 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(), ProcLine(), ProcName() |
Category: | Debug functions , xHarbour extensions |
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