If this is the case, is there any disadvantage of doing duplicate rather than 
structcopy? - It would seem that duplicate would
always work...

-----Original Message-----
From: Christopher Olive [mailto:[EMAIL PROTECTED]]
Sent: 12 November 2001 15:21
To: CF-Talk
Subject: RE: Request Scope Questions


if i understand correctly, a week or so ago you (dave) mentioned that
duplicate was only necessary for a session structure if it contained
other complex variables.  you said that StructCopy was sufficient if it
was merely a structure with simple variables.  is this correct?

christopher olive, cto, vp of web development
cresco technologies, inc
410.825.0383
http://www.crescotech.com


-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 11, 2001 5:00 PM
To: CF-Talk
Subject: RE: Request Scope Questions


> A couple of notes here: if you do this, use something like
>
> <cfset request.var=Duplicate(session.var)>
>
> to transfer the variable. If you don't use Duplicate() - correct
> me if I'm wrong someone! - then request.var just becomes a 'pointer'
> to session.var, and session.var is still actually read when you
> refer later to request.var (rendering the whole business kind of
> redundant!). Duplicate() - which is only available in CF4.5+ -
> makes request.var a 'deep' copy of session.var, and then request.var
> technically has nothing to do with session.var except having the
> same value.

It's only necessary to use Duplicate in this case if Session.var is a
structure or a query. If it's just a simple value, you don't need to
worry -
simple values are always passed by value, not by reference.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to