Re: Dumping VAR Scope?
perhaps just to debug this particular issue, you could install the trial version of cf9 so that you can cfdump the local scope. Russ On Sat, Dec 4, 2010 at 11:25 PM, Rick Root rick.r...@gmail.com wrote: On Sat, Dec 4, 2010 at 10:15 AM, andy matthews li...@commadelimited.com wrote: If you're running CF9, you can dump the LOCAL scope. Variables are placed in this scope by default in CF9. Thanks. We're not talking about CF9. Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339795 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Sun, Dec 5, 2010 at 6:49 AM, Russ Michaels r...@michaels.me.uk wrote: perhaps just to debug this particular issue, you could install the trial version of cf9 so that you can cfdump the local scope. It's more of a theoretical discussion. My coworker (who actually wanted to know) ended up re-writing the function and local scoping all the variables :) I will try that other potential method when I get a chance though... Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339797 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
It's more of a theoretical discussion. My coworker (who actually wanted to know) ended up re-writing the function and local scoping all the variables :) I will try that other potential method when I get a chance though... The re-write is probably for the best. The undocumented stuff is only good for debugging, and I believe they removed it anyway in CF9. -Leigh ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339800 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
You can't. This one reason why, prior to CF9, I always did var local = {}; at the top of my functions, and placed all function-local vars into that struct. On Fri, Dec 3, 2010 at 11:15 AM, Rick Root rick.r...@gmail.com wrote: How do you dump the var scope inside a CFC? Qualifiers - not on CF9, and not using cfset var LOCAL = StructNew() I can tell you what DOESN'T work. cfdump var=#variables# cfdump var=#variables.myFunctionName# Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339801 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Sun, Dec 5, 2010 at 3:49 PM, Brian Kotek brian...@gmail.com wrote: You can't. This one reason why, prior to CF9, I always did var local = {}; at the top of my functions, and placed all function-local vars into that struct. Definately a best practice for earlier versions... I've been doing that myself for a year or so.. but I've been at this job since 2002, so there's some code that doesn't do it ;) Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339802 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
Based on the other responses, dumping the var scope in CF8 is not possible. Rick Check Ben Nadel's blog. I thought there was an undocumented function that provided access to the var (ie thread local scope) through getPageContext() in CF8 (only). -Leigh ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339775 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
(ie thread local scope) That should be function local obviously. BTW: The function I was thinking of is: getPageContext().getActiveFunctionLocalScope() http://www.bennadel.com/blog/758-ColdFusion-GetPageContext-Massive-Exploration.htm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339776 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
Doesn't cfdump var=local work? Sent from my Verizon Wireless Phone - Reply message - From: Matt Quackenbush quackfu...@gmail.com Date: Fri, Dec 3, 2010 3:40 pm Subject: Dumping VAR Scope? To: cf-talk cf-talk@houseoffusion.com On Fri, Dec 3, 2010 at 1:48 PM, Eric Roberts wrote: cfdump var=#variables# will dump everything That will only dump the variables scope of the CFC, and all of the functions/methods. It will **not** dump the var'd variables of a specific function. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339779 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Dumping VAR Scope?
If you're running CF9, you can dump the LOCAL scope. Variables are placed in this scope by default in CF9. -Original Message- From: Rick Root [mailto:rick.r...@gmail.com] Sent: Friday, December 03, 2010 11:05 AM To: cf-talk Subject: Re: Dumping VAR Scope? On Fri, Dec 3, 2010 at 12:03 PM, Matt Quackenbush quackfu...@gmail.com wrote: Rick, to my knowledge there is no way to dump the var'd variables as a whole. That said, of course you can always dump individual var'd variables. That is my suspicion as well ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339781 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Sat, Dec 4, 2010 at 10:15 AM, andy matthews li...@commadelimited.com wrote: If you're running CF9, you can dump the LOCAL scope. Variables are placed in this scope by default in CF9. Thanks. We're not talking about CF9. Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339787 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Dumping VAR Scope?
Is the CFC defined output=true Robert B. Harrison Director of Interactive Services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be . Plug in to our blog: AW Unplugged http://www.austin-williams.com/unplugged -Original Message- From: Rick Root [mailto:rick.r...@gmail.com] Sent: Friday, December 03, 2010 11:16 AM To: cf-talk Subject: Dumping VAR Scope? How do you dump the var scope inside a CFC? Qualifiers - not on CF9, and not using cfset var LOCAL = StructNew() I can tell you what DOESN'T work. cfdump var=#variables# cfdump var=#variables.myFunctionName# Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339738 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Fri, Dec 3, 2010 at 11:17 AM, Robert Harrison rob...@austin-williams.com wrote: Is the CFC defined output=true No, but that's not relevant. if output is true or false, you can still call cfdump var=whatevercfabort and it will dump it. Or you can put the dump inside a Cfm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339739 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
(nic sent this reply to me off list but I want to keep the discussion ON list) On Fri, Dec 3, 2010 at 11:23 AM, nic.tun...@nictunney.com wrote: Throw a cfabort after it. I'm already doing that... Neither of the things I mentioned actually dumps the var scoped variables... #variables# dumps the function names #variables.functionName# dumps metadata about the function (arguments, return type, etc) Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339741 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
Rick, to my knowledge there is no way to dump the var'd variables as a whole. That said, of course you can always dump individual var'd variables. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339743 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Fri, Dec 3, 2010 at 12:03 PM, Matt Quackenbush quackfu...@gmail.com wrote: Rick, to my knowledge there is no way to dump the var'd variables as a whole. That said, of course you can always dump individual var'd variables. That is my suspicion as well ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339746 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
ISTR that in CF9 it creates an internal scope called called local so try cfdump var=#local# Russ On Fri, Dec 3, 2010 at 4:57 PM, Rick Root rick.r...@gmail.com wrote: (nic sent this reply to me off list but I want to keep the discussion ON list) On Fri, Dec 3, 2010 at 11:23 AM, nic.tun...@nictunney.com wrote: Throw a cfabort after it. I'm already doing that... Neither of the things I mentioned actually dumps the var scoped variables... #variables# dumps the function names #variables.functionName# dumps metadata about the function (arguments, return type, etc) Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339748 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
Rick, Short answer: You can't. Long answer: This was a design flaw that was corrected in ColdFusion 9. In CF9, you can dump #local#, which is the function local var scope. Earlier than that, you best option is to create a struct for your function-local variables, so many people do this: [pseudocode, writeDump and abort are CF9 specific] function foo(arg, etc) { local = structNew(); local.myLocalVariable = 1234; writeDump(local);abort; } Hope that helps. nathan strutz [http://www.dopefly.com/] [http://hi.im/nathanstrutz] On Fri, Dec 3, 2010 at 9:15 AM, Rick Root rick.r...@gmail.com wrote: How do you dump the var scope inside a CFC? Qualifiers - not on CF9, and not using cfset var LOCAL = StructNew() I can tell you what DOESN'T work. cfdump var=#variables# cfdump var=#variables.myFunctionName# Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339749 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Fri, Dec 3, 2010 at 12:05 PM, Russ Michaels r...@michaels.me.uk wrote: ISTR that in CF9 it creates an internal scope called called local so try cfdump var=#local# Which is why I had this in my original post: Qualifiers - not on CF9, and not using cfset var LOCAL = StructNew() =) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339751 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
sorry missed that. On Fri, Dec 3, 2010 at 5:08 PM, Rick Root rick.r...@gmail.com wrote: On Fri, Dec 3, 2010 at 12:05 PM, Russ Michaels r...@michaels.me.uk wrote: ISTR that in CF9 it creates an internal scope called called local so try cfdump var=#local# Which is why I had this in my original post: Qualifiers - not on CF9, and not using cfset var LOCAL = StructNew() =) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339753 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Dumping VAR Scope?
cfdump var=#variables# will dump everything -Original Message- From: Matt Quackenbush [mailto:quackfu...@gmail.com] Sent: Friday, December 03, 2010 11:03 AM To: cf-talk Subject: Re: Dumping VAR Scope? Rick, to my knowledge there is no way to dump the var'd variables as a whole. That said, of course you can always dump individual var'd variables. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339764 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Fri, Dec 3, 2010 at 2:48 PM, Eric Roberts ow...@threeravensconsulting.com wrote: cfdump var=#variables# will dump everything No, it won't. Have you tried doing that inside a CFC function in a component? Here's a test I ran... foo is the only thing not dumped =) cfcomponent cfset a = 1 cfset variables.b = 2 cfset this.c = 3 cffunction name=testfunction access=remote output=false returnType=void cfset var foo = 1 cfdump var=#variables# cfabort /cffunction /cfcomponent Based on the other responses, dumping the var scope in CF8 is not possible. Rick ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339767 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Dumping VAR Scope?
On Fri, Dec 3, 2010 at 1:48 PM, Eric Roberts wrote: cfdump var=#variables# will dump everything That will only dump the variables scope of the CFC, and all of the functions/methods. It will **not** dump the var'd variables of a specific function. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339769 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm