Reputation: 22810
OK, it's my first try with ColdFusion and I'm having some serious trouble.
I just tried
writeDump(someVar);
within a <cfscript>
block, and it keeps throwing errors.
What's going on?
P.S. What I'm trying to do is something similar to php's print_r
or var_dump
; so if you know of a better/alternative way to achieve the very same thing, I'm all ears! :-)
Upvotes: 1
Views: 491
Reputation: 1605
Taking James's idea forward, what is your CF version, because writedump
will work only in version 9 & later. If you are on version 8 or earlier, you have to use <cfdump var="#someVar#">
If you have to use it in cfscript
, then you can write your own custom function
<cffunction name="myDump" returntype="void">
<cfargument name="arg" required="true" type="any">
<cfdump var="#Arguments.arg#">
</cffunction>
and then call this function inside cfscript
block
mydump(somevar);
Upvotes: 6