Coldfusion: RTFM
CFDUMP has lots of extra properties to make your life easier, but to make a short story long:
I should probably keep my discussions to more profound things, but since the following little tidbit has come up a several times in the last few days, it is probably worth mentioning just so I don't forget it.
As a programmer, I can get to be pretty damn lazy, and that sometimes mean relying on code hinting a bit too much. Luckily, I frequently shake myself free from it, particularly when I am in some strange machine using Notepad and the developer version of CF to solve some really odd job that would best be done with other tools. Anyway, the good thing about Notepad is that it really sucks and therefore forces me to know what it is I am supposed to be doing. And that is how I came to find out that CFDUMP will go straight to a file if you ask it nicely. This would be completely unremarkable except that my currently installed version of CFEclipse doesn't recognize the extra properties needed to do this.
In the most recent incidents, I was using a gateway to listen to a folder and I was helping Alex debug an issue located in the bowels of some very old spaghetti code - I was the cook so I guess I'm obliged to help, in at least some small way, make the inevitable changes. Anyway, these are all situations where there is no way to dump to the screen and it wouldn't even be practical to employ any sort of framework. In the case of my folder listener, the whole application is literally one method of roughly 10 lines in one cfc and its associated config file (and it replaces $2000 worth of dedicated software - long story, but sometimes I really love Coldfusion).
So even though nearly all my uses of CFDUMP look like <cfdump var="someVar"> the available options are way more extensive:
<cfdump
var = "#variable#"
expand = "yes|no"
format = "text|html"
hide = "columns|keys"
keys = "number of keys to display for structures"
label = "text"
metainfo = yes|no"
output = "browser|console|file"
show = "columns|keys"
showUDFs = "yes|no"
top = "number of rows|number of levels">
However, I am really only nattering about the following combination:
<cfdump
var = "#variable#"
format = "html"
output = "c:\dumpFile.html">
So, this has been a very low calorie post, but there are a few quasi-important points:
- What we know can kick us in the butt - things change and assumptions can quickly become wrong and doing it the old way could mean wasting a lot of time and resources.
- References are your friend. Install Digital Editions on your desktop and load it with handy reference pdfs. It will help abate the issues Brian mentioned on laziness
- I really do like to milk a topic for way more than it's worth


There are no comments for this entry.
[Add Comment]