I don't know if Dave said that or not, but the statement is correct. In
general, I just always use Duplicate. Perhaps structcopy is 0.0000001%
faster, but to be honest, I'd rather just use Duplicate() which I know
will always work right.


Bare in mind that CF 4.5 had a.... um, 'issue' with Duplicate. You can
download a hotfix for it though.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Christopher Olive [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, November 12, 2001 10:21 AM
> 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
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
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