Two follow up questions.  You can't directly use the var key word in the
<cfquery> tag; <cfquery name="var joe"...>.  Also, when exactly does this
data get garbage collected?  Since it is in a method, does a query get
created and destroyed every time that method is used?  I does it persist for
the life of the entire component?

--------------
Ian Skinner
Web Programmer
BloodSource
Sacramento, CA


-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 12:38 PM
To: CF-Talk
Subject: RE: CFC Newbie Discussion.


> 
> So this example was meant to show how to protect variables 
> inside the method? If I follow correctly, you created a 
> variable scoped to the 'var' scope (named "myQuery"), then 
> set the variable equal to the value of the Query? Does this 
> mean that, if I follow what you say below...
>

Correct. Because you have to set a value IMMIDIATELY when you var
scoped, I just use the empty string.

> > ANY variable created inside a method should be var scoped 
> (unless you 
> > want it to exists outside the method). Don't forget things like 
> > <cfquery> create values, ditto for cfdirectory, etc.
> 
> ...that normally, a query object that would be created, as a 
> result of performing a query, are now only available to that 
> method (since you scoped it 'var') and as soon as the object 
> is no longer being used, the variable 'disappears' as part of 
> the whole CFC garbage collection?

Yes.

> Is it garbage collection?

I've been reamed before for daring to not use the _exact_ precise word,
so, I'll say, maybe, yea, probably so. ;)

<ducks the language police>

-rc


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to