> What do you mean?   You mean like variables.thevalue... or do you
> mean like  thisinstance.thisvalue, so each subsequent run has different 
> values?

The info that Ray pointed to gives a lot of great information.  The
short version is that you can define those variables to be private and
local to the function which instructs the runtime to throw them away
when the function is done rather than holding them in memory for a
long period.  In your case:

<cfset tempImage_path="#rootpath#\assets\project_gallery\temp">

Would become:

<cfset var tempImage_path="#rootpath#\assets\project_gallery\temp">

That extra "var" attribute after cfset tells the runtime that this is
a private local variable and safe to discard once the function exits.
In older versions of ColdFusion all of the "var" type variables had to
be defined immediately after any cfargument tags at the beginning of
the function.  Once defined you refer to them normally within the
function code.

In newer versions (9 and 10) you can use the "local" scope within the
function instead, such as:

<cfset local.tempImage_path="#rootpath#\assets\project_gallery\temp">

This will accomplish the same thing as using the "var" attribute.


-Justin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:355894
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to