Thursday, July 24, 2008    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< May 2007 >>
S M T W T F S
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Search

Categories
 • Adobe (63) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (14) [RSS]
 • AIR (116) [RSS]
 • Appearances (115) [RSS]
 • Books (67) [RSS]
 • CFEclipse (14) [RSS]
 • ColdFusion (1120) [RSS]
 • Data Services (8) [RSS]
 • Flash (95) [RSS]
 • Flex (345) [RSS]
 • Jobs (88) [RSS]
 • JRun (12) [RSS]
 • Labs (27) [RSS]
 • LiveCycle (17) [RSS]
 • MAX (149) [RSS]
 • Regular Expressions (12) [RSS]
 • SQL (36) [RSS]
 • Stuff (498) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (133) [RSS]
 • Wireless (97) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Entry / Main
May 1, 2007

ColdFusion And JavaScript Like Operators

This one was met with a round of applause last night in Dallas. In Scorpio you can now use the following in CFML expressions:

++ -- % += -= *= /= %= && || !

In addition, in <CFSCRIPT> you can use the following operators:

== != < <= > >=

Related Blog Entries

TrackBacks
There are no trackbacks for this entry.

No trackback URL. Trackbacks are only allowed via interactive form.

Comments
I may have clapped the loudest for this, lol. Love the idea, finally a ++, and a % for CF!

And bravo for figuring out the validation nightmare that must have been "if(a<b) || (a>c)". It sure looks like it should validate as a tag, but grats for figuring it out and including it! Well done!

Do we call it CF++ now? :)
# Posted By Steven Van Gemert | 5/1/07 10:08 AM
Yay, finally! Good one :)

Ben, say are there by any chance plans to give developers the oppertunity to write cfc's *completely* on a script basis, too? Like defining a component with a class (~component) keyword rather than using the tag syntay? Also, will there be mechanisms like interfaces or abstract classes in CF++? ;)

Cheers, Thomas
# Posted By Thomas Rühl | 5/1/07 10:27 AM
Give them an inch and they want a mile. ;-)

Thomas, interfaces are in Scorpio, but no plans for for class creation in script. And, without starting a big debate on the subject, I would be very opposed to this idea myself. If you want components defined as classes, well, use Java, it does it really well. But, ya never know.

--- Ben
# Posted By Ben Forta | 5/1/07 10:31 AM
Great to have you in DFW! A question came to mind about the CFIMAGE tag. Currently we have an image server which we use some of the same functionality you talked about with CFIMAGE. Will there be any caching available of images (or is that me just dreaming to big)? Can you manipulate the DPI? We keep hi-res JPEGs (300 dpi) for print and then our image server renders them as 72 dpi for display.

I am so very, very excited and can't wait for the release of CF8. Thanks for your wonderful presentation last night!
# Posted By KEVIN BENORE | 5/1/07 10:34 AM
That is awesome, I'm very excited about the new operators. I have a question though. I've been told IIF is very slow. Is the following going to work?

a = (b == true) ? c : d;
# Posted By Kevin | 5/1/07 10:51 AM
Ben said:

Give them an inch and they want a mile.

True Ben, but please realize that we're REALLY grateful for the inch! :)

Steven
# Posted By Steven Van Gemert | 5/1/07 11:14 AM
Steven said:
True Ben, but please realize that we're REALLY grateful for the inch! :)

hell, we are :D
Cheers, Thomas
# Posted By Thomas Rühl | 5/1/07 12:03 PM
++

That is sweeeet! I feel like giving you my first born :D
# Posted By Ben Nadel | 5/1/07 12:34 PM
that's pretty cool!
# Posted By hibiscusroto | 5/1/07 1:37 PM
This is AWESOME!!! It is so irritating not having the incremental operators. That will be awesome. It only makes sense, getting closer to ECMAScript.

Now, to go for the mile.. ;-) I agree with Kevin that it would be awesome to have support for ? as in:
a = (b == true) ? c : d;
# Posted By Joshua Curtiss | 5/1/07 1:49 PM
IIF() was slower than CFIF in earlier versions of ColdFusion but in MX they compile down to the exact same code.
# Posted By Michael Dinowitz | 5/1/07 3:03 PM
a = (b == true) ? c : d; is called a ternary operator. ;)
# Posted By Steven Ross | 5/1/07 3:07 PM
pretty awesome Ben!

I hate doing

<cfset foo = foo + 1>

Now I can do

<cfset foo++>

Now if you can add a &= operator.

<cfset foo = foo & "some string">

becomes

<cfset foo &= "some string">
# Posted By Rick Root | 5/1/07 3:19 PM
Rick,
I'm willing to be that with CF being dynamic and all that this will work for you:
<cfset foo += "some string" />
# Posted By Matt Williams | 5/1/07 3:46 PM
Finnnnnnnnnnnally! This is a feature that has been missing for a long time. ;)
# Posted By shuns | 5/2/07 12:19 AM
Rick,
Not sure why, it's not in the list.
But, you can do &= for string concatination.
(The tour just came through PDX on Monday).
Awsome stuff.
I'm excited to be a CF developer.
# Posted By Chris Phillips | 5/2/07 12:30 PM
>> Can you manipulate the DPI? We keep hi-res JPEGs (300 dpi)
>>for print and then our image server renders them as 72 dpi for display.

Kevin, no, this is not supported at this time.

--- Ben
# Posted By Ben Forta | 5/2/07 6:19 PM
One thing I've missed is the ability to effectively loop a query in script. Something like this would be awesome:

forin(query||struct[,item]){}
# Posted By Dustin | 5/8/07 1:51 PM
sooo! wicked! definitely past due
# Posted By sal | 6/6/07 12:06 AM

  © Copyright 1997-2008 Ben Forta, All Rights Reserved