weird.
if i had to venture a guess, i'd say that BOTH session.nameObj and
variables.namePointer are references to the same underlying object. When
you call structDelete(session,"nameObj") you are deleting a pointer
(hence the error when you try to reference it later) but the other
pointer still exists...
this is, as mentioned, just a guess...
/t
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of John Samson
Sent: Monday, September 26, 2005 8:49 PM
To: [email protected]
Subject: [CFCDev] CFC Assignment Query
If CFCs are copied by reference [as the output at line 8
suggests] then how come I can still reference an object [line 10] once
it has been deleted [line 9]? I would expect line 10 to throw an error
but it doesn't, however, an attempt to reference session.nameObj at the
same place does.
Can anyone help me understand what I am seeing?
1. <cfapplication sessionmanagement = "true">
2. <cfset session.nameObj = createObject('component',
'nameComponent').init()>
3. <cfset session.nameObj.setName("Elaine")>
4. <cfoutput>
5. <cfset variables.namePointer = session.nameObj>
6. #variables.namePointer.getName()#<br>
7. <cfset session.nameObj.setName("Richard")>
8. #variables.namePointer.getName()#<br>
9. #structDelete(session, "nameObj")#
10. #variables.namePointer.getName()#<br>
11. </cfoutput>
________________________________
To help you stay safe and secure online, we've developed the all
new Yahoo! Security Centre
<http://us.rd.yahoo.com/mail/uk/taglines/default/security_centre/*http:/
/uk.security.yahoo.com/> .
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of
the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by
CFXHosting (www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]