Re: var keyword in cfcs ... needed for query names?
On Tuesday 12 Jun 2007, Brian Kotek wrote: I asked Tim, Tom and Adam (and voted for a feature request) for an administrator option to do just this in CF8, but alas... Yup, me too. Since CF6 :-) -- Tom Chiverton Helping to proactively improve prospective models on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280957 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
but is overkill.. On 6/13/07, D F [EMAIL PROTECTED] wrote: And what of variables that aren't prefixed with var in a cfc? Does that mean that their memory allocation persists? if so, for how long? BTW That was a good idea to create a local structure and store all your local var variables there... good one. Also, aren't they deleted after the function runs? Meaning that they no longer take up that memory allocation? -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 11:50 AM To: CF-Talk Subject: RE: var keyword in cfcs ... needed for query names? What was the reason for doing this again... to prevent race conditions? You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280960 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
Absolutely. You must specify var scoping for ALL method local variables including query names and loop indexes. On 6/12/07, D F [EMAIL PROTECTED] wrote: When using the var keyword at the beginning of a cfc function, does one need to specify using var the variable names of any queries which are to be defined within that cfc function? ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280791 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
Absolutely. Queries are usually the first thing overlooked and need to be var scoped because in the end it is just a variable holding complex data. Always var your query names to keep the data local to the function. Dan Vega http://www.danvega.org/blog/ On 6/12/07, D F [EMAIL PROTECTED] wrote: When using the var keyword at the beginning of a cfc function, does one need to specify using var the variable names of any queries which are to be defined within that cfc function? ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280792 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
so a simple ... cfset var qryMyQuery = would do, or is there a better way? Absolutely. Queries are usually the first thing overlooked and need to be var scoped because in the end it is just a variable holding complex data. Always var your query names to keep the data local to the function. Dan Vega http://www.danvega.org/blog/ On 6/12/07, D F [EMAIL PROTECTED] wrote: When using the var keyword at the beginning of a cfc function, does one need to specify using var the variable names of any queries which are to be defined within that cfc function? ~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280796 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: var keyword in cfcs ... needed for query names?
What was the reason for doing this again... to prevent race conditions? ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280803 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: var keyword in cfcs ... needed for query names?
To keep them private to the functions. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: D F To: CF-Talk Sent: Tue Jun 12 17:33:19 2007 Subject: Re: var keyword in cfcs ... needed for query names? What was the reason for doing this again... to prevent race conditions? ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280804 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: var keyword in cfcs ... needed for query names?
What was the reason for doing this again... to prevent race conditions? You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280805 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: var keyword in cfcs ... needed for query names?
On 6/12/07, Brian Kotek [EMAIL PROTECTED] wrote: Absolutely. You must specify var scoping for ALL method local variables including query names and loop indexes. you *SHOULD* ... not *MUST* Just being argumentative :) . If must was the right word, then CF would generate an error if you didn't. Personally, I think that'd be nice. but they'll never do it. I think they should automatically var scope EVERYTHING in a method unless otherwise specifically scoped elsewhere. Rick ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280807 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
On 6/12/07, Dave Watts [EMAIL PROTECTED] wrote: You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. That's for UDFs. For methods in CFCs, you var-declare local variables so they don't clobber any variables with the same names in the VARIABLES scope of the component itself. (I know Dave knows this - I'm just clarifying for folks reading who might not appreciate the difference) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280808 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: var keyword in cfcs ... needed for query names?
Also, aren't they deleted after the function runs? Meaning that they no longer take up that memory allocation? -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 11:50 AM To: CF-Talk Subject: RE: var keyword in cfcs ... needed for query names? What was the reason for doing this again... to prevent race conditions? You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280810 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
Well, yeah they exist only within the functions duration - i.e. Call. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Andy Matthews To: CF-Talk Sent: Tue Jun 12 18:00:27 2007 Subject: RE: var keyword in cfcs ... needed for query names? Also, aren't they deleted after the function runs? Meaning that they no longer take up that memory allocation? -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 11:50 AM To: CF-Talk Subject: RE: var keyword in cfcs ... needed for query names? What was the reason for doing this again... to prevent race conditions? You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| Macromedia ColdFusion MX7 Upgrade to MX7 experience time-saving features, more productivity. http://www.adobe.com/products/coldfusion?sdid=RVJW Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280811 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: var keyword in cfcs ... needed for query names?
I use cfset var local = StructNew() at the top of my functions, and then in the body of the function you could say cfquery name=local.queryName without worrying about it. You are basically creating a local scope for use within the function, and I find this much easier to stick with then varing each variable at the top of the function. Mark -Original Message- From: D F [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 12:18 PM To: CF-Talk Subject: Re: var keyword in cfcs ... needed for query names? so a simple ... cfset var qryMyQuery = would do, or is there a better way? Absolutely. Queries are usually the first thing overlooked and need to be var scoped because in the end it is just a variable holding complex data. Always var your query names to keep the data local to the function. Dan Vega http://www.danvega.org/blog/ On 6/12/07, D F [EMAIL PROTECTED] wrote: When using the var keyword at the beginning of a cfc function, does one need to specify using var the variable names of any queries which are to be defined within that cfc function? ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280814 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: var keyword in cfcs ... needed for query names?
And what of variables that aren't prefixed with var in a cfc? Does that mean that their memory allocation persists? if so, for how long? BTW That was a good idea to create a local structure and store all your local var variables there... good one. Also, aren't they deleted after the function runs? Meaning that they no longer take up that memory allocation? -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 12, 2007 11:50 AM To: CF-Talk Subject: RE: var keyword in cfcs ... needed for query names? What was the reason for doing this again... to prevent race conditions? You declare local variables in a function so that they don't clobber any variables with the same names in the script that calls the function. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280816 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: var keyword in cfcs ... needed for query names?
On 6/12/07, D F [EMAIL PROTECTED] wrote: And what of variables that aren't prefixed with var in a cfc? Does that mean that their memory allocation persists? if so, for how long? those variables exist as long as the components variables scope exists. Ie, until the request ends - unless the component is loaded into a persistent scope like thee application scope, and then those variables exist until the component is destroyed. Rick ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280820 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: var keyword in cfcs ... needed for query names?
I asked Tim, Tom and Adam (and voted for a feature request) for an administrator option to do just this in CF8, but alas... On 6/12/07, Rick Root [EMAIL PROTECTED] wrote: On 6/12/07, Brian Kotek [EMAIL PROTECTED] wrote: Absolutely. You must specify var scoping for ALL method local variables including query names and loop indexes. you *SHOULD* ... not *MUST* Just being argumentative :) . If must was the right word, then CF would generate an error if you didn't. Personally, I think that'd be nice. but they'll never do it. I think they should automatically var scope EVERYTHING in a method unless otherwise specifically scoped elsewhere. Rick ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280871 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4