Short circuit as of 4.0.1, but no earlier.

Trust me on this one; I had to redo almost every cfif in an entire site 
because a client refused to install 4.0.1 (4.0 was causing problems on the 
machine and obviously installing 4.0 wasn't going to help. Noooooooooo.) 
Clients. Hrmph.

At 04:28 PM 1/17/01 -0500, you wrote:
>"Note: Because ColdFusion has short-circuit Boolean evaluation..." this is
>the only reference I could find
>(http://www.allaire.com/handlers/index.cfm?ID=15923&Method=Full) but I'm
>sure I read something about it the packaged docs as well. In short CF has
>supported short circuit AND statments for a while, if it's not working for
>you I can only mirror the previous reply and suggest looking for typos.
>
>-----Original Message-----
>From: Eric Dawson [mailto:[EMAIL PROTECTED]]
>Sent: January 17, 2001 12:09
>To: CF-Talk
>Subject: RE: Short Circuit Evaluation
>
>
>hmmm. I never noticed. Would have coded a few things differently. I'll check
>it out tonight.
>Eric
>
>
>From: "Raymond Camden" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: RE: Short Circuit Evaluation
>Date: Wed, 17 Jan 2001 10:25:25 -0500
>
>Last time I checked, CF _did_ have short circuit eval. Maybe you have a
>slight typo in your code? This feature has been around since 4.01 I believe.
>(Maybe earlier, someone feel free to correct me.)
>
>=======================================================================
>Raymond Camden, Principal Spectra Compliance Engineer for Allaire
>
>Email   : [EMAIL PROTECTED]
>ICQ UIN : 3679482
>
>"My ally is the Force, and a powerful ally it is." - Yoda
>
>  > -----Original Message-----
>  > From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
>  > Sent: Wednesday, January 17, 2001 10:12 AM
>  > To: CF-Talk
>  > Subject: Short Circuit Evaluation
>  >
>  >
>  > I have had to write this kind of code over and over, and was wondering if
>  > there is a better way like in c++, where it does lazy evaluation.
>  >
>  > This is what I want:
>  >
>  > <CFIF isDefined("somevar") AND somevar IS "something">
>  >     do something
>  > </CFIF>
>  >
>  > Of course this fails, since if the variable is not defined, CF stil
>checks
>  > the second condition.  In languages like C++, it did lazy
>  > evaluation, so if
>  > the first condition was false, it didn't bother checking the second
>  > condition.  This let people write things like
>  >
>  > open(FILE,"file") || die "Can't open file";
>  >
>  > So in CF I have to rewrite my above IF statement as 2 statements
>  >
>  > <CFIF isDefined("somevar")>
>  >      <CFIF somevar IS "something">
>  >           do something
>  >      </CFIF>
>  > </CFIF>
>  >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to