and if you have a valid license for it :-p




-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: 01 August 2002 14:41
To: CF-Talk
Subject: RE: Good CFCatch code


And you can always use cfa_dump from Spectra if you have it.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Al Everett [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, August 01, 2002 9:32 AM
> To: CF-Talk
> Subject: RE: Good CFCatch code
> 
> 
> > <cfdump> isn't available on CF 4.5.x.
> 
> Then create one. Here's the code from my <CF_DUMP> tag:
> 
> <cfsetting enablecfoutputonly="yes">
> <!--- 
>   Usage:        <cf_dump
>                     var = "..."
>                 >
> 
>   Attributes:   var (var, required) - variable to be dumped
>   
>  --->
> 
> <!--- attributes validation --->
> <cfparam name="attributes.var">
> <cfset var = attributes.var>
> 
> <cf_IsWddx input="#var#" r_output="decodedVar" r_bIsWDDX="bIsWddx">
> 
> 
> <cfif bIsWddx>
> 
>   <cfoutput>
>   <table border="2" cellspacing="0" cellpadding="1" bgcolor="##ffffff"
> bordercolor="Black">
>   <tr><td valign="top">
>    </cfoutput>
> 
>   <cf_dump var="#decodedVar#">
> 
>   <cfoutput>
>   </td></tr></table>
>   </cfoutput>
> 
> <cfelseif IsStruct(var)>
> 
>   <cfoutput>
>   <table border="1" cellspacing="0" cellpadding="1" bgcolor="##aaaaee"
> bordercolor="Blue">
>   </cfoutput>
> 
>   
>   <!--- dump keys one by one --->
>   <cfloop collection="#var#" item="keyName">
>     <cfoutput>
>     <tr>
>     <td valign="top">#keyName#</td>
>     <td valign="top" bgcolor="##ffffff">
>     </cfoutput>
>     
>     <cfif IsSimpleValue( var[keyName] )>
>       <cfif Left( var[keyName], 11 ) neq "<wddxPacket" >
>         <cfoutput>#var[keyName]#</cfoutput>
>       <cfelse>
>         <cf_dump var="#var[keyName]#">
>       </cfif>
>     <cfelse>
>       <cf_dump var="#var[keyName]#">
>     </cfif>
> 
>     <cfoutput>
>     </td>
>     </tr>
>     </cfoutput>
>   </cfloop>
> 
>   <cfoutput>
>   </table>
>   </cfoutput>
> 
> <cfelseif IsArray(var)>
> 
>   <cfoutput>
>   <table border="1" cellspacing="0" cellpadding="1" bgcolor="##cceecc"
> bordercolor="Green">
>   </cfoutput>
> 
>   <cfset size = ArrayLen(var)>
>   <!--- dump items one by one --->
>   <cfloop index="i" from="1" to="#size#">
>     <cfoutput>
>     <tr>
>     <td valign="top">#i#</td>
>     <td valign="top" bgcolor="##ffffff">
>     </cfoutput>
>     
>     <cfif IsSimpleValue( var[i] )>
>       <cfif Left( var[i], 11 ) neq "<wddxPacket" >
>         <cfoutput>#var[i]#</cfoutput>
>       <cfelse>
>         <cf_dump var="#var[i]#">
>       </cfif>
>     <cfelse>
>       <cf_dump var="#var[i]#">
>     </cfif>
>     
>     <cfoutput>
>     </td>
>     </tr>
>     </cfoutput>
>   </cfloop>
> 
>   <cfoutput>
>   </table>
>   </cfoutput>  
>   
> <cfelseif IsQuery(var)>
> 
>   <cfset colList = var.columnList>
> 
>   <cfoutput>
>   <table border="1" cellspacing="0" cellpadding="1" bgcolor="##eeaaaa"
> bordercolor="Red">
>   <tr bgcolor="##eeaaaa" >
>   <cfloop list="#colList#" index="colName">
>     <td valign="top">#colName#</td>
>   </cfloop>
>   </tr>
>   </cfoutput>
>   
>   
>   <!--- scroll thru rows --->
>   <cfloop query="var">
>     <cfoutput><tr></cfoutput>
> 
>     <!--- create deep copy of each field --->
>     <cfloop list="#colList#" index="col">
>       <cfoutput><td valign="top" bgcolor="##ffffff"></cfoutput>
> 
>       <cfif IsSimpleValue( var[col][currentRow] )>
>         <cfif Left( var[col][currentRow], 11 ) neq "<wddxPacket" >
>           <cfoutput>#var[col][currentRow]#</cfoutput>
>         <cfelse>
>           <cf_dump var="#var[col][currentRow]#">
>         </cfif>
>       <cfelse>
>         <cf_dump var="#var[col][currentRow]#">
>       </cfif>
> 
>       <cfoutput></td></cfoutput>
>     </cfloop>
> 
>     <cfoutput></tr></cfoutput>
> 
>   </cfloop>
> 
>   <cfoutput>
>   </table>
>   </cfoutput>
>   
> <cfelse>
>   
>   <cfoutput>#var#</cfoutput>
>   
> </cfif>
> <cfsetting enablecfoutputonly="no">
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
> 

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to