Wednesday, February 08, 2012    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Jan 2004 >>
S M T W T F S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
             

Search

Categories
 • Acrobat (5) [RSS]
 • Adobe (110) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (66) [RSS]
 • AdobeMAX09 (39) [RSS]
 • AdobeMAX10 (34) [RSS]
 • AdobeMAX11 (27) [RSS]
 • AIR (297) [RSS]
 • Appearances (217) [RSS]
 • Books (86) [RSS]
 • CFEclipse (15) [RSS]
 • Cloud (1) [RSS]
 • ColdFusion (1477) [RSS]
 • ColdFusion Builder (22) [RSS]
 • Data Services (42) [RSS]
 • Fish Tank (5) [RSS]
 • Flash (356) [RSS]
 • Flex (562) [RSS]
 • Home Automation (5) [RSS]
 • HTML5 (22) [RSS]
 • JavaScript (2) [RSS]
 • Jobs (130) [RSS]
 • jQuery (14) [RSS]
 • JRun (14) [RSS]
 • Labs (62) [RSS]
 • LiveCycle (37) [RSS]
 • MAX (284) [RSS]
 • Mobile (239) [RSS]
 • Regular Expressions (19) [RSS]
 • RIA (21) [RSS]
 • SQL (45) [RSS]
 • Stuff (554) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (167) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • Mark Doherty
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Day : January 24, 2004 / Main
January 24, 2004

Use for Debugging

was introduced to ColdFusion in version 5, but apparently there are many CFers who have yet to discover this invaluable tag. In the past week I received three different code help e-mail requests, all of which I answered with suggestions, all of which included the use of in test code, and all of which were met with responses to the effect of "huh, I've never used before.

So, is an all-purpose data display tool. Give it a simple variable and it'll display it. But can do more than just display simple variables, it can render entire queries, arrays, structures, XML document objects, instantiated ColdFusion Components, Java objects, and any combination of the above (an array of structures containing an array of queries, for example). You can even entire scopes (like SESSION, or VARIABLES) because those are actually structures.

In other words, can display most of what standard debug output can, and a whole lot more too. In fact, come to think of it, I have not used standard debug output in a long time, nowadays I rely mostly on .

If you have yet to use this remarkable tag, do so, quickly. But one point to keep in mind, expects expressions, not names of variables. So, if you the word VARIABLES will be displayed, to dump all variables you'd need .

Comments
The label= attribute is very useful too so you can annotate the dump output:

[cfdump label="session scope before call to foo()" var="#session#"]
[cfset foo()]
[cfdump label="session scope after call to foo()" var="#session#"]
# Posted By seancorfield | 1/25/04 12:31 PM
I just wish that cfdump's output displayed better then using a standards complient html doctype. I have found that I use the coloration of the cells of the output. Other then that cfdump rocks!
# Posted By Kurt Wiersma | 1/25/04 3:10 PM
Is there a particular reason that the CSS for the object type is white text?

Most pages I work with I have a white background, and I can never see the object type unless I highlight the the page's text. I've heard about ways to make it change, but its my understanding that they entail making changes that aren't allowed under the CF license.
# Posted By Danilo | 1/25/04 3:44 PM
yeah ive been wondering why they encrypted the code for cfdump and a few other things.

a tool you can customize to suit your needs is a much better tool.
# Posted By mike | 1/25/04 4:08 PM
FYI, you can get a modified version of cfdump here:

http://www.camdenfamily.com/morpheus/blog/index.cf...

It allows you to dump an array or query and display only the top N items. You can also filter by columns or struct keys.
# Posted By Raymond Camden | 1/25/04 10:49 PM
Thanks Raymond, I'll take a look at it.
# Posted By Danilo | 1/25/04 11:21 PM
Is there any better way to dump CFC objects? Dumping an object only shows the methods in it, is there any way to display member variables as well (i.e. those defined outside of a method)? (or if there is I've completely missed it)
# Posted By Brian Billman | 1/27/04 9:04 AM
Ben, I have a doubt here:

Do you remember that in the CF 5 the cfdump tag doesn't works with the scope variables?
I remember that I had to make some modifications to dump my crated variables because it doesn't work.
Was it a bug?

Regards,

Marcos Placoná
# Posted By Marcos Placoná | 1/29/04 12:22 PM
Marcos, in earlier versions of CF the scopes were not structures, but now they all are.
# Posted By Ben Forta | 1/30/04 8:23 AM
On the cell coloration, the tag does not put a # in front of the color numbers. Adding that character to the color fixes the problem in IE.

The tag would be easy to fix...if it weren't encrypted. I guess MM changed their mind, since an earlier blog entry indicated they were not.
# Posted By Jonathan Keller | 3/5/04 2:10 PM

  © Copyright 1997-2009 Ben Forta, All Rights Reserved