Michael said:
What happens if you copy structures into the request scope? AFAIK a
structure copy like 'Request.s = Application.s' only copies a pointer to
the structure. Isn't there a problem when one template reads
Request.s.foo, while another template sets or modifies Application.s.foo?

That's why you use the Duplicate() function. It creates a real copy, not a
pointer. If you don't have CF 4.5.1, then you must use StructCopy(), but be
aware that StructCopy() has a bug. If Application has a key that's a
structure itself, then when you structcopy it, every 'first' level key will
be really copied, but the second level structure will create a pointer.

Example:
<CFSET A = StructNew()>
<CFSET A.Name = "Ray">
<CFSET A.Lower = StructNew()>
<CFSET B = StructCopy(A)>
At this point, if I do:
<CFSET B.Name = "CCC">
It will NOT change A.Name.
But, if I do this:
<CFSET B.Lower.Foo = "ddd">
it WILL set A.Lower.Foo.

So, if you have CF 4.01, you must keep your App scope 'one level deep',
that's if you want to use the 'copy to request' trick.

=======================================================================
Raymond Camden, Cold Fusion Jedi Master for Syntegra (www.syntegra.com)
Allaire Certified Instructor and Member of Team Allaire

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

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

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to