Whatever message this page gives is out now! Go check it out!
CallStackDump(output)Parameter | Description |
output | Optional parameter that takes one of the following values:
|
<cftry>
<cfinclude template="fact.cfm">
<cfcatch type="any">
<cfoutput>
#cfcatch.message#
<br>#cfcatch.detail#
<br>
</cfoutput>
</cfcatch>
</cftry><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>