An update on this...

Despite the new jar file that Vince sent this morning - Thanks Vince.

I was still running into lots of issues, so I wrote a dumpVar() function
that works in both BD and CFMX. It allows you to dump the value of a
variable and abort regardless of the output supression level.

Please feel free to use, test, redistribute etc.

CODE BEGINS
***********************************************************
<!--- 
Description: Generic dump function for CFMX 6.1 or BlueDragon 6.1 that
allows you to dump the value of a variable regardless of the output
supression settings.
Author: Spike - [EMAIL PROTECTED] 
Usage: 
Typical usage is when debugging complex apps that have debug supression
turned on.
e.g.
Just after the function declaration
request.dumpvar = dumpvar 

Somewhere inside a nested CFC method

<cfset request.dumpVar(arguments)>

--->
<cffunction name="dumpVar" access="public" returntype="void" output="true"
hint="Dumps any variable regardless of output supression settings.">
    <cfargument name="variable" type="any" required="true" hint="The
variable to dump" /> 
    <cfargument name="reset" type="boolean" required="false" default="false"
hint="Indicates whether or not to discard the output up to this point"> 
    <cfargument name="abort" type="boolean" required="false" default="true"
hint="Indicates whether or not to abort processing once the variable has
been dumped." />
        <cfsavecontent variable="dump">
            <cfoutput>
                <cfdump var="#arguments.variable#">
            </cfoutput>
        </cfsavecontent>
        <cfif arguments.reset>
            <cfcontent reset="true" />
        </cfif>
        <cfset
getPageContext().getResponse().getWriter().print(JavaCast('string',dump))>
        <cfset getPageContext().getResponse().getWriter().flush()>
        <cfif arguments.abort>
            <cfabort showerror="Processing aborted after dumping variable">
        </cfif>
</cffunction>
<cfset request.dumpVar = dumpVar>

*******************************************************
CODE ENDS

Spike


--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org 


 

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Stephen Milligan
>Sent: Tuesday, June 29, 2004 2:05 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] CFEXIT or CFABORT within CFFUNCTION
>
>I use cfabort all the time when debugging apps.
>
>I've found it an absolute pain in the ass that BlueDragon behaves
>differently to CFMX in this regard.
>
>In CFMX any time you have a cfabort inside a function, you can 
>use cfoutput
>or cfdump before it in the same function call to show the 
>value of variables
>at that point. In BlueDragon it respects the output attribute of the
>function. 
>
>If you're not inside a nested function call hierarchy you can 
>set the output
>attribute of the function to true temporarily to get around 
>this, but if you
>are inside a hierarchy you're in for debug hell.
>
>I've just about given up on trying to debug Farcry on 
>BlueDragon for this
>very reason.
>
>Of course, if BlueDragon supported the cftrace tag that might offer a
>possible solution to the output problem.
>
>Spike
>
>--------------------------------------------
>Stephen Milligan
>Code poet for hire
>http://www.spike.org.uk
>
>Do you cfeclipse? http://cfeclipse.tigris.org 
>
>
> 
>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf Of Vince Bonfanti
>>Sent: Tuesday, June 29, 2004 1:39 PM
>>To: [EMAIL PROTECTED]
>>Subject: [CFCDev] CFEXIT or CFABORT within CFFUNCTION
>>
>>Can anyone think of any legitimate use of CFEXIT or CFABORT with a
>>CFFUNCTION? I can't: if the functions finishes normally use 
>>CFRETURN, if
>>abnormally use CFTHROW.
>>
>>I can't find any docs that say use of CFEXIT or CFABORT is allowed or
>>disallowed within CFFUNCTION. I'd be in favor or saying 
>>they're disallowed,
>>and have the CFML server (BlueDragon/ColdFusion) throw a syntax error
>>("illegal tag nesting", or some such) if they're attempted to 
>>be used this
>>way.
>>
>>Any thoughts? Am I missing something?
>>
>>Vince Bonfanti
>>New Atlanta Communications, LLC
>>http://www.newatlanta.com
>>
>>
>>
>>
>>----------------------------------------------------------
>>You are subscribed to cfcdev. To unsubscribe, send an email
>>to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
>>in the message of the email.
>>
>>CFCDev is run by CFCZone (www.cfczone.org) and supported
>>by Mindtool, Corporation (www.mindtool.com).
>>
>>An archive of the CFCDev list is available at 
>>www.mail-archive.com/[EMAIL PROTECTED]
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>An archive of the CFCDev list is available at 
>www.mail-archive.com/[EMAIL PROTECTED]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to