> I've heard somewhere that by assigning a structure varialbe (or
> another complex variable) to
> a diffrent variable by using something like:
> <CFSET copyofstruct=OldStructer>
> I'm just assigning a pointer for that structure
> and To "FULLY" copy this variable I need to use some Duplicate() function.

Correct. To see this in action, do:

<CFSET A = StructNew()>
<CFSET B = A>
<CFSET A.foo = 1>
<CFOUTPUT>#B.foo#</CFOUTPUT>


> correct? what function exactly? and does Arrray consider complex
> variable too?
>

To really copy A instead of creating a pointer, the correct code would be:

<CFSET B = Duplicate(A)>

Please note though that there is a small bug in Duplicate() for really
complex vars. You can download a patch at Allaire.com.

Does this apply to arrays? No.... for simple arrays. However, an array of
structures would suffer from the same issue. You would want to use
Duplicate() for those kind of variables.

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

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

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


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to