>- see footer for list info -<
Arguments are not always private to a function. They are only private
for variables that are passed by value, reference types are passed by
reference and so are not private.

I am not really trying to get a critique of the code. I didn't write
it but I have inherited it and was trying to work out the best
solution for allowing me to upgrade to cf9 without making so many
changes.

A little more investigation reveals that you cannot assign anything to
local as it will be ignored, so removing the var does not help either.

Simon Baynes
www.simonbaynes.com
Free online storage you can access anywhere:-
http://www.simonbaynes.com/getsugarsync
LinkedIn profile:- http://www.linkedin.com/in/simonbaynes



On Mon, May 17, 2010 at 12:05 PM, Michael Traher
<[email protected]> wrote:
>>- see footer for list info -<
> I would say there was never any need to assign arguments to another var
> scoped structure in CF7, 8 or 9 since arguments are already private to the
> function, however if you have this dotted through your code you can probably
> just remove the 'var' infront of local and all will work.
>
> It does mean some search and replace work and we have some instances of this
> in our code (not duplicating arguments but setting up a var scoped structure
> called local).
>
> On 17 May 2010 11:57, Simon Baynes <[email protected]> wrote:
>
>> >- see footer for list info -<
>> In cf7 and cf8 if you do the following:-
>>
>>
>> <cffunction name="duplicateIssue" access="public" output="false"
>> returntype="void" hint="">
>>        <cfargument name="arg1" type="string" required="true" hint="">
>>        <cfargument name="arg2" type="string" required="true" hint="">
>>        <cfargument name="arg3" type="string" required="true" hint="">
>>        <cfset var local            = duplicate(arguments)>
>>        <cfset var local2            = duplicate(arguments)>
>>        <cfdump var="#local#">
>>        <cfdump var="#local2#">
>>        <cfabort>
>> </cffunction>
>>
>>
>> <cfset duplicateIssue()>
>>
>>
>> They will output the same. However, in CF9 the first assignment to
>> local is ignored and the local scope is populated. This means that the
>> current application I work on cannot be migrated to CF9, as there are
>> lots of occurances where the arguments scope is being duplicated into
>> a struct called local. I know why this was added in CF9 to make life
>> apprently easier for people who don't like varring things but it has
>> changed the behaviour quite drastically and will take a lot of chages
>> and testing for me to upgrade.
>>
>>
>> Any advice would be greatly appreciated,
>>
>>
>> Simon
>>
>>
>> Simon Baynes
>> www.simonbaynes.com
>> Free online storage you can access anywhere:-
>> http://www.simonbaynes.com/getsugarsync
>> LinkedIn profile:- http://www.linkedin.com/in/simonbaynes
>>
>> _______________________________________________
>>
>> For details on ALL mailing lists and for joining or leaving lists, go to
>> http://list.cfdeveloper.co.uk/mailman/listinfo
>>
>> --
>> CFDeveloper Sponsors:-
>> >- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>> >- Lists hosted by www.Gradwell.com -<
>> >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
>>
>
>
>
> --
> Mike
> _______________________________________________
>
> For details on ALL mailing lists and for joining or leaving lists, go to 
> http://list.cfdeveloper.co.uk/mailman/listinfo
>
> --
> CFDeveloper Sponsors:-
>>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>>- Lists hosted by www.Gradwell.com -<
>>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
>

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to