Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

cfmailparam behaviour change in CF9.01ColdFusion Job Opportunity in Houston, TXFacial Recognition in 14 Lines Of ColdFusionColdFusion UPS PackageColdFusion Job Opportunity in Arlington, VAColdFusion Job Opportunity in San Diego, CASome ColdFusionBloggers.org GuidelinesColdFusion Positions In CaliforniaListChangeDelimsunix epoch with coldfusionQuery scripting bug in Coldfusion 9Scoth On The Rock 2011 Tickets on salefoursquareCFC updated to version 1.0, now includes ColdFusion return typeFramework One Birds of a Feather session at CFUnitedWhat makes you a good ColdFusion programmer?

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

MXNA webfeed

Visit Carlos Gallupa

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.

4094 viewed | 7 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  

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..



The answer to the ultimate question is?? (42 ;-))




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