Subsribe to our RSS

latest reactions

Tjarko
@michael nope.. still under development, …
Michael van Leest
Any luck with socket connections? I need …
andy matthews
Check out my "lorem ipsum" rep …
Ray
Same for me - replacing several cases of …
Jax
Looks like you need to replace the batte …

Use OpenDNS

mxna feeds

Book Review PHP 5 Objects, Patterns, and PracticeColdFusion shared hosting security and databasesUpdated CF Evangelism Kit PostedFlorida SEO » The ColdFusion Maniac ReturnsFlex Frameworks: You Now Have OptionsGetting line numbers to show up in CFeclipse on OSXThe Oldest Files in My Home DirectoryThe Oldest Files in My Home DirectoryRocketFM Project on RIAForge2 new contracts for the new yearUpdated ColdFusion Evangelism KitColdFusion Competitive Comparison to Java, ASP.NET and PHPSuggestions for improving the ColdFusion market in JapanWin A ColdFusion Rocks T-Shirt In JanuaryReminder about ColdFusion Unconference

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2009 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos GallupaPowered by ColdFusion MX

Use NOT or use !, it's all possible

Today I came across a piece of code made by a co-worker and in the 11 years that I use ColdFusion I never knew it was possible.... and i'm guessing that's it's only possible since MX.

The piece of code below works...

<cfset var = 1 />

<cfif !var>
    Do something
</cfif>

To use ! is the same as using NOT in the cfif statement. Pretty darn nice!! Probably old news but for me it was something I never saw anywhere in CF code.

1217 viewed | 8 opinion(s)  | del.icio.us | Digg it | Tjarko @ 22/10/08 17:33 cet


Reactions:

injun #576871 wrote.... (site)

Yeah, I'm using CF about 6 years, and I never knew it was possible too.
Thanks for useful post!

22 October 2008 17:47 cet  

Kevin wrote....

Hi, it's something new in CF8.There are several others that are new like:

i += 1; instead of i = i + 1;
i *= 2; instead of i = i * 2;

&& = AND
|| = OR

There are more too.

22 October 2008 20:26 cet  

Michael Sharman wrote.... (site)

Yep, as Kevin mentioned this is new to CF8 and is something that was sorely missed in the language.

CF8 has lots of nice new language enhancements, check out the new implicit struct and array creation syntax as well.

22 October 2008 22:45 cet  

Ted Danson wrote....

Wow, let's welcome CF to the 90s.Most other languages have been using !, +=, &&, || syntax for years.Way to bring it up to ECMA specs right before EOLing it Adobe.

22 October 2008 23:26 cet  

Chris wrote.... (site)

@Ted Danson,

say, do the other languages offer ways to send an email, do a full text search or a database query with just 1 line of code? If so, welcome to the advantages that ColdFusion developers have had for more than 12 years now.

And about EOLing it... there is a public roadmap for new relaeases until 2011. No talk about EOL for ColdFusion among the well informed people.

23 October 2008 9:26 cet  

jax wrote....

Ted must be a php fan...

Most Ted's are.

24 October 2008 16:44 cet  

Tjarko wrote....

sdf asfdsf dsfsdf dasfdasf

26 November 2008 17:42 cet  

Jax wrote....

Looks like you need to replace the batteries in your keyboard Tjarko.

30 November 2008 0:05 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



A dozen apples are how many?? (12 would be a good answer for this)




URL en mail addresses are translated for you... life sometimes is that simple!!