callStackGet

Returns an array of structs by default. Each struct contains template name, line number, and function name (if applicable). This is a snapshot of all function calls or invocations.

callStackGet() → returns any

Argument Reference

type string
Default: array

Lucee 4.5+ The type of the returned value

offset numeric
Default: 0

Lucee 5.3.8+ The number of frames to skip

maxFrames numeric
Default: 0

Lucee 5.3.8+ The maximum number of frames to return

Examples
Sample code invoking the callStackGet function

This example the factorial of a number is computed.

<!--- callfact.cfm --->
<cftry>
    <cfinclude template="fact.cfm">
<cfcatch type="any">
    <cfoutput>
        #cfcatch.message#
        <br>#cfcatch.detail#<br>
    </cfoutput>
</cfcatch>
</cftry>

This example the factorial of a number is computed.

<!--- fact.cfm --->
<cfscript>
    numeric function factorial(n) {
        if (n == 1) {
            writeDump(callStackGet());
            writeOutput('<br>');
            return 1;
        }
        else {
            writeDump(callStackGet());
            writeOutput('<br>');
            return n * factorial(n-1);
        }
    }
    factorial(5);
</cfscript>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub