callStackDump

Similar to the function callStackGet except that it outputs a string representation of the call stack.

callStackDump(output) → returns void

Argument Reference

output string
Default: browser

If you chose "file" and do not provide the complete path to the file, the file is written to the temp directory as determined by the function getTempDirectory().
Values:
  • console
  • browser
  • file

Examples
Sample code invoking the callStackDump function

In this example, the factorial of a number is computed. The example is similar to the example for CallStackGet except that the function used here is callStackDump.callfact.cfm

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

fact.cfm

<cffunction name="factorial" hint="returns the factorial of a number" output="true">
       <cfargument name="n" required="yes" type="numeric" hint="The number for which the factorial is returned" />
       <cfif n eq 1>
              <cfset callStackDump()>
              <cfreturn 1>
       <cfelse>
              <cfset callStackDump()>
              <cfreturn n * factorial(n - 1)>
       </cfif>
</cffunction>
<cfoutput>Factorial of 5 - #factorial(5)#</cfoutput>

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

Fork me on GitHub