Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

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]

Comments Comments (3) | Print Print | Send Send | 312 Views

(Comment Moderation is enabled. Your comment will not appear until approved.)
It's been in Railo for as long as I can remember. Glad you like it.
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.
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]
BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .