Yes ok I get it now, *ignore* my last email...

There is still a reference, i.e. the one in the server scope itself..
OK, I understand it now.

So, references change, but do not get deleted when one of the references get
deleted.
Ok all clear, thanks.

Taco Fleur


> -----Original Message-----
> From: Dave Watts [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 19 November 2004 12:55 AM
> To: CF-Talk
> Subject: RE: Reference to complex var not destroyed
> 
> 
> > I don't think you understand me correctly, I understand that
> > a REFERENCE is created and not a copy of the structure 
> > itself, if you read my message again you might see this.
> > 
> > My question is: why is the reference not destroyed when the
> > original structure is? When I update the original structure 
> > with another value the reference is updated, but why not 
> > destroyed?
> 
> No, I understood you correctly. When you create a structure 
> using, say, StructNew, you're actually creating two things - 
> the structure itself, and a reference to the structure. The 
> structure itself can have as many references as you like, and 
> they all point you back to the actual structure.
> 
> <cfset foo = StructNew()> <!-- creates a structure, and a 
> reference called "foo" ---> <cfset foo.var = "val"> <cfset 
> bar = foo> <!--- creates a second reference that points to 
> the same structure as "foo" does ---> <cfset foo = ""> <!--- 
> overwrites the "foo" reference with a "foo" variable 
> containing a simple value - doesn't affect the structure that 
> foo pointed to
> --->
> 
> The structure itself will stick around as long as there's at 
> least one reference still around.
> 
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> phone: 202-797-5496
> fax: 202-797-5444
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184809
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to