Hi Alan,

Thanks for the reply. I would like to ask if assigning complex data
types is pass by reference, why is it only happening in function, and
when the data is VARed? Isn't there the need to have some consistency?
Please advise.

Thanks
WW

On Jun 21, 7:36 pm, Alan Williamson <[email protected]> wrote:
> You are mistaken with the assumption that the line:
>
> <cfset var aCategoryTest = aCategory>
>
> is a deep copy.  It is not.  It is a copy by reference.  This is how
> Java/Javascript operates.
>
> If you wish to make a truly "deep" copy, then your best way is to use
> the function Duplicate() which was designed for the very thing you are
> looking for.
>
> Hope this helps
>
> On Jun 21, 7:25 am, wcube <[email protected]> wrote:
>
>
>
>
>
>
>
> > I've encountered this problem that is while in a function and 'var'
> > the complex data type, it will be passed by reference in a way.
> > (tested with array and struct)

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to