-
1. Re: Feature for CF11, global LOCAL var scoping
Aegis Kleais Oct 17, 2013 8:12 PM (in response to Aegis Kleais)For the time being, I'm simply using a set.
<cfset var LOCAL = {
'var1' = 'val1',
'var2' = 'val2'
} />
-
2. Re: Feature for CF11, global LOCAL var scoping
duncancumming Oct 18, 2013 1:03 AM (in response to Aegis Kleais)You could also do it like this:
<cfset var LOCAL = {}>
<cfset structAppend(LOCAL, {
'variable1' = 'value1',
'variable2' = 'value2'
}, true ) />
I'm not sure why you'd want to say "structAppend(var LOCAL". Also just to complicate things the local scope in your functions you shouldn't need to create as a locally-var'd variable at all; it's in-built since 9. So really you could just do:
<cfset structAppend(LOCAL, {
'variable1' = 'value1',
'variable2' = 'value2'
}, true ) />
job done! See http://forta.com/blog/index.cfm/2009/6/21/The-New-ColdFusion-LOCAL-Scope
-
3. Re: Feature for CF11, global LOCAL var scoping
Aegis Kleais Oct 18, 2013 6:57 AM (in response to duncancumming)Whoa, never knew that. That perfectly solves my problem. Thanks for the knowledge bomb, Duncan!

