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
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi Ruslan,
Actually, CF 4.01 and above do support Short Circuit evaluation...
maybe you should upgrade.
Aaron Johnson, MCSE, MCP+I
Allaire Certified ColdFusion Developer
MINDSEYE, Inc.
phn617.350.0339
fax617.350.8884
icq66172567
[EMAIL PROTECTED]
Ruslan,
Every since CF4.01, CF has supported short-circuit logic. So the you're
first example *does* work in CF4.01+.
-Dan
-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
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hey Ruslan,
Sure... what you mentioned works for me all the time...
cfif IsDefined("somevar") AND somevar EQ "something"
Do this
cfelse
Do this
/cfif
However, the loop thing you mentioned
At 10:12 1/17/01 -0500, you wrote:
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
I think this
Cold fusion uses Lazy evaluation.
I use the exact syntax you posted regularly in CF 4.5.1.
Russel
Russel Madere, Jr. Senior Web Developer
ICQ: 5446158 http://www.TurboSquid.com
Some days you eat the bear;
CFIF (isDefined("somevar") AND somevar IS "something")
do something
cfelse
do nothing
/CFIF
JUstin
-Original Message-
From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 3:12 PM
To: CF-Talk
Subject: Short Circuit Evaluation
I have had to write
I am not sure what version of CF you are running but you can do what you
want in 4.5.
The other way around it is to use CFPARAM to set it as empty then check it.
eg
cfparam name="somevar" default=""
cfif somevar is "something"
do something
/cfifi
tim P.
-Original Message-
From:
Right you are. CF 4.0 does not have short-circuit evaluation but if you
really are running 4.0 you should probably upgrade to 4.0.1 regardless of
this problem. 4.0 thinks Febuary 29th never exists. And other glorious
Things That Have Been Corrected(tm).
At 10:25 AM 1/17/01 -0500, you wrote:
short answer custom tag.
longer answer: tell allaire to change the cfif.
Eric
From: Ruslan Sivak [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Subject: Short Circuit Evaluation
Date: Wed, 17 Jan 2001 10:12:09 -0500
I have had to write this kind of code over and
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 must have been mistaken. I will try to go and see the exact code that was
causing that error.
Russ
-Original Message-
From: Aaron Johnson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 10:45 AM
To: CF-Talk
Subject: RE: Short Circuit Evaluation
-BEGIN PGP SIGNED
The ability to "lazy" evaluation has been in ColdFusion since v 4.01
cfif IsDefined("somevar") and somevar IS "somestring"
Duane
-Original Message-
From: Eric Dawson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 12:05 PM
To: CF-Ta
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
rted 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 nev
15 matches
Mail list logo