Railo allowing var'ing at any point in CFC

This is one of those features I know is coming in ColdFusion 9, but I don't know if its new in Railo 3.1.0.024 or been there for a while?

Anyway i've just found out you can "var" your variables in a CFC at any point. This isn't copying the way CF9 is planning on handling this by adding it to the LOCAL scope but it does mean you don't have to put everything at the top. Even though I'll most likely keep all my vars at the top for now its good to know that the following bit of code which in the past would throw an error now works fine.

[sourcecode language="plain"] <cffunction name="text" access="public" returntype="string" output="false"> <cfset doSomethingFirst() /> <cfset var b = "set second" /> <cfreturn b /> </cffunction> [/sourcecode]

Posted: 02-Aug-2009

View: 720

Permalink: here

Comments

It's been in Railo for as long as I can remember. Glad you like it.

#1 Sean Corfield
03/Aug/09 1:56 AM

This was one of my first favorite selling points about Railo, I always found it annoying to have to declare local variables @ the top of the functions. This also works in bluedragon I believe.

#2 Jeff Gladnick
03/Aug/09 5:34 PM

I have a used iphone with no sims card. I already use at&t so i was wondering how i can get the phone on and be able to use my sim card from my other phone.....HELP step by step please



________________
[url=http://unlockiphone22.com]unlock iphone[/url]

#3 italk
31/Dec/09 6:27 AM