I'm trying to do some debugging. But since it is inside the cfscript I can't use cfabort and cfdump. is there similar function for cfcsript debugging?
Ian Skinner - 11 Jan 2008 19:16 GMT
> I'm trying to do some debugging. But since it is inside the cfscript I can't use cfabort and cfdump. is there similar function for cfcsript debugging?
One trick is to put the tag into a function and then call that function
from within <cfscript...>
I.E.
<cffunction name="dumpFunc"...>
<cfargument name="variable"....
<cfdump var="#variable#>
</cffunction>
<cfscript>
//Stuff
//More Stuff
//Even More Stuff
dumpFunc(session)
</cfscript>
Don't know if this would work, but it is how I usually get a
<cfquery...> tag into a <cfscript...> block when that is necessary.
JohnEric - 30 Jan 2008 21:22 GMT
If you do any component development at all, you can add a dump and an abort
function to the base component.
Add the following to the file <cfinstall
dir>\wwwroot\WEB-INF\cftags\component.cfc
<cffunction name="dump" returntype="void" output="true">
<cfdump var="#arguments#">
</cffunction>
<cffunction name="abort" returntype="void" output="false">
<cfset dump(argumentCollection=arguments) />
<cfabort>
</cffunction>
Then you can do something like the following
<cfscript>
someObj = createObject('component', 'path.to.obj');
someObj.dump(avar=structNew());
someObj.abort(var1='abc', var2=arrayNew(1));
</cfscript>