I think that I missed this in the docs. It seems that you can chain
set variables
cfset a=1
cfset c=b=a+1
This will give you a=1, b=2, c=2.
On a related note, the following will fail
cfset a=1
cfset c=b+1=a+1
The chain works as long as there is no operation except on the
right-most item in
A quick test indicates it's new in CF9. Worth mentioning that it is
NOT treating the assignment as an expression, it is only allowing
multiple variables to be assigned to a single expression. Your second
test case would fail regardless of which one CF was doing, but this
example also fails
6.1 doesn't like it...
Eric
-Original Message-
From: Michael Dinowitz [mailto:mdino...@houseoffusion.com]
Sent: Monday, March 01, 2010 3:33 PM
To: cf-talk
Subject: chain variable setting
I think that I missed this in the docs. It seems that you can chain
set variables
cfset a=1
I've just run a regex against the cfdocs and I can't find any
reference to this new chaining functionality. This implies it's a new
and overlooked functionality. I wonder what else is un-noted.
Assignments in loop conditions has been around for a while. If it's a
CFLoop then you can only alter
It was definitely added in CF9 but you are right, I don't see it
listed in What's New in Coldfusion 9. Curious.
This is the reference page for this particular functionality however:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS328B9130-F922-4ddb-B78B-8817CA81F8E3.html
Cheers,
Judah
Not only did I miss it, my regex didn't find it because it assumed a
cfset. There are a few things not mentioned in the what's new
section. This is only one of them. :(
--
Michael Dinowitz
On Mon, Mar 1, 2010 at 5:07 PM, Judah McAuley ju...@wiredotter.com wrote:
It was definitely added in
6 matches
Mail list logo