• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Dumping Variable Contents

When debugging, it is often useful to be able to inspect the contents of a variable. Simple variables can be displayed by merely enclosing them within <cfoutput> tags, but more complex variables (for example, arrays and structures, which are explained in Chapters 14 and 15 respectively) cannot be displayed in this way.

To solve this problem, you may use the <cfdump> tag, which displays a variable (even a complex nested variable) in a clean, easy-to-read format. You'd never actually use <cfdump> in final production code, but this tag is invaluable during development and debugging. For example, to display a single variable you could use the following code:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint