It is sometimes useful for a procedure or function to obtain information about its caller(s). The HELP procedure returns, in a string array, the contents of the procedure stack when the CALLS keyword parameter is specified. The first element of the resulting array contains the module name, source filename, and line number of the current level. The second element contains the same information for the caller of the current level, and so on, back to the level of the main program.
For example, the following code fragment prints the name of its caller, followed by the source filename and line number of the call:
HELP, CALLS = A ;print 2nd element PRINT, 'called from:', A
This results in a message of the following form:
Called from: DIST </usr2/idl/lib/dist.pro (27)>
Programs can readily parse the traceback information to extract the source file name and line number.