Debugging ColdFusion using the CFDUMP tag

Readability

Debugging ColdFusion using the CFDUMP tag

The fol­low­ing exam­ple shows how you can debug Cold­Fu­sion scripts using the <CFDUMP> tag, or writeDump() method.



Or, if you are using a <CFSCRIPT> tag, you could use the writeDump() method, as seen in the fol­low­ing example:


arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog");
writeDump(arr);

And the out­put of the <CFDUMP> tag and writeDump() method is as fol­lows:

You can also spec­ify the for­mat of the <CFDUMP> out­put (plain text for­mat­ting or a col­lapsi­ble HTML for­mat­ting) by spec­i­fy­ing the format attribute, as seen in the fol­low­ing example:



Or, if you are using a <CFSCRIPT> tag, you can spec­ify the format para­me­ter, as seen in the fol­low­ing example:


arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog");
writeDump(arr, "browser", "text");

And the out­put of the writeDump() method is as fol­lows:

The following example shows how you can debug ColdFusion scripts using the <CFDUMP> tag, or writeDump() method.

<cfset arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog") />
<cfdump var="#arr#" />

Or, if you are using a <CFSCRIPT> tag, you could use the writeDump() method, as seen in the following example:

<cfscript>
arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog");
writeDump(arr);
</cfscript>

And the output of the <CFDUMP> tag and writeDump() method is as follows:

You can also specify the format of the <CFDUMP> output (plain text formatting or a collapsible HTML formatting) by specifying the format attribute, as seen in the following example:

<cfset arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog") />
<cfdump var="#arr#" format="text" />

Or, if you are using a <CFSCRIPT> tag, you can specify the format parameter, as seen in the following example:

<cfscript>
arr = listToArray("The,Quick,Brown,Fox,Jumps,Over,The,Lazy,Dog");
writeDump(arr, "browser", "text");
</cfscript>

And the output of the writeDump() method is as follows:

Leave a Reply

Your email address will not be published.