Var statements in cfscript

This one passed me so I thought I’d point it out. As you know, MX introduced the idea of the tag based UDFs. To do var scope declarations, you used this syntax:

<cfset var foo = goo>

Many people preferred to write their UDF blocks in cfscript statements, but you were not allowed to use var foo = goof inside a cfscript block inside a tag based UDF because var statements had to come after any cfargument tag and before any other cftag, include cfscript. Now with CF MX 6.1, you are allowed to use cfscript and var statements in your cffunction based methods/udfs. I hope that made sense. Basically, one more sought after feature was added by Macromedia!

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments