Railo and multi-variable assignments rock!

Railo and multi-variable assignments rock!

Posted by Luis Majano
Apr 03, 2009 00:00:00 UTC
I found a neat little feature in Railo 3.1 which I myself is calling multi-variable assignments.

Let's say you want to assign a value to multiple variables in coldfusion. You would usually do this:

Name = "Luis Majano";

ColdboxAuthor = Name;

CodexAuthor = Name;

AwesomenessAuthor = Name;

That is really neat right, well, Railo makes it fun!

Name = "Luis Majano"

ColdboxAuthor = CodexAuthor = AwesomenessAuthor = Name

How about that!! I can assign values to multiple variables, by just concatenaning the equals. Keep exploring Railo and you will find some nice hidden gems.


Will B.

I think I read that you can do this in CF9, when it comes out. Sure does look familiar.

Henry Ho

Eww.. don't like it at all. :)

Jason H

I've always liked the java way of doing things:

myVar, myVar2, myVar3 = 0;

Sadly I've been waiting since CF6 for this to work :(

Site Updates

Entry Comments


Entries Search