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 "var"ing 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