Dumping and Aborting With

One of the annoying things about cfscript is it’s lack of support for a lot of CFML tags.

and are 2 tags I always use in development, especially for debugging. A way to use this functionality is to create a UDF to do these types of functions.

For example

1
2
3
4
5
6
7
8
<cffunction name="dump" access="public" output="true" returntype="struct">
    <cfargument name="arg" />
    <cfdump var="#arg#" />
</cffunction>

<cffunction name="abort" access="public" output="false" returntype="void">
    <cfabort />
</cffunction>

This function can be stored in a simple utilities component and stored in application scope, that way you can call it from anywhere.

Comments