Dec 31, 2009

ColdFusion 9 and the local scope continued

This post is to try clear up any confusion on yesterdays post. The issue was a little confusing and that is probably due to the fact the the example came from some code that was not normal. Ie the code did work as expected it's just not something someone would normally do so it lead to some confusion.

Thanks to Glen who constantly came back with what was really going on I see what I originally thought might have been an error with CF9 was actually functioning as expected.

Here is the demo running: http://cf9.kukiel.net/demos/local/demo4.cfm

All the scopes function the same way as intended.

Anything inside a method that is var scoped will go into the local scope.

local is a scope and will always exist within a method so in CF9 you don't need to define it as its already there.

Here is another sample block of code:

0 comments:

Post a Comment