I think it is you who is misunderstanding Dave. request.a = StructNew(); //creates a structure with reference request.a request.b = request.a; //creates a reference request.b to the same structure StructDelete(request,"a"); // deletes the REFERENCE request.a (not the structure)
I don't know the inner workings of CF, but I suspect that if you then do StructDelete(request,"b"); the structure still exists, but there is simply no way to reference it anymore (I could be wrong here) Pascal > -----Original Message----- > From: Taco Fleur [mailto:[EMAIL PROTECTED] > Sent: 18 November 2004 06:21 > To: CF-Talk > Subject: RE: Reference to complex var not destroyed > > > This is the correct behavior in CF as well as in any other language I > know > of in which you can pass values by reference. The conceptual error you're > making is that there is no "original" structure - there is simply a > structure that has one or more references. When you create a structure and > put it in a variable, that variable contains a reference to the structure, > rather than the structure itself. > > Dave, > > 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? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:184706 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54