Russ,
Seeing as no one has actually answered your question as to why your IIF
isn't working, here's the reason.
You say that if qryCustomer.allareas is FALSE then and only then you get
qryAreas. This is the reason for your IIF not working.
When IIF is interpreted by the CF Server all
On Sunday, September 8, 2002, at 09:33 , Joe Eugene wrote:
I dont agree with Sean or Dave...
That doesn't surprise me Joe :)
i dont think IIF is necessary but its
a very useful function ... IF USED PROPERLY
I didn't say it wasn't *useful* - I just said it was bad practice and
could always
: Monday, September 09, 2002 11:00 AM
To: CF-Talk
Subject: Re: iif usage
On Sunday, September 8, 2002, at 09:33 , Joe Eugene wrote:
I dont agree with Sean or Dave...
That doesn't surprise me Joe :)
i dont think IIF is necessary but its
a very useful function ... IF USED PROPERLY
I didn't say
: Monday, September 09, 2002 1:59 PM
Subject: Re: iif usage
On Sunday, September 8, 2002, at 09:33 , Joe Eugene wrote:
I dont agree with Sean or Dave...
That doesn't surprise me Joe :)
i dont think IIF is necessary but its
a very useful function ... IF USED PROPERLY
I didn't say it wasn't
On Monday, September 9, 2002, at 11:16 , Joe Eugene wrote:
Good (humor) Sean...~!
No humor at all.
I agree there are bad practices...
(evaluate,cflocation, variable prefixes, spaghetti code and some others)
but i dont think you should include IIF in them...
Well, I've been dealing with
like it and and the
performance from your method is the best it can be, use it. So.
My 2 cents.
Mike
-Original Message-
From: Joe Eugene [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 2:17 PM
To: CF-Talk
Subject: Re: iif usage
Good (humor) Sean...~! I agree
IIF has its place. Someone correct me if I am wrong, but I
thought I read on this list weeks ago that with MX, IIF was
just as fast as CFIF.
I don't think that's possible, although I could be wrong.
When you use IIf or Evaluate, you're evaluating a string as if it were an
expression. I
Dave,
I think Michael Dinowitz stated it if I recall correctly. I am not 100% sure.
Mike
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 2:43 PM
To: CF-Talk
Subject: RE: iif usage
IIF has its place. Someone correct me if I am wrong
qryCustomer.allareas should be a 0 or any number other than 0 which is
True
your statment should look like below.. u dont need DE
#IIF(qryCustomer.allareas, 'All Areas' , '#ValueList(qryAreas.name,',')#'
)#
Which means if qryCustomer.allareas !=0 ...display ALL Areas
else
Display qryAreas.name
, September 08, 2002 5:49 PM
To: CF-Talk
Subject: Re: iif usage
qryCustomer.allareas should be a 0 or any number other than 0 which
is
True
your statment should look like below.. u dont need DE
#IIF(qryCustomer.allareas, 'All Areas' ,
'#ValueList(qryAreas.name,',')#'
)#
Which means if qryCustomer.allareas
Try
#IIF(qryCustomer.allareas, DE('All Areas'),
DE('#ValueList(qryAreas.Name)#'))#
Havent tested it but it should work...
The downside of using an IIF() against an if() statement is that the
true and false sections are always evaluated... Whereas a normal if
statement if its true the false is
PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Sunday, September 08, 2002 6:03 PM
Subject: RE: iif usage
#iif(qryCustomer.allareas,All Areas, '#ValueList(qryAreas.name,',
')#' )#
Doesn't work either.
Parameter 1 of function ValueList which is now qryAreas.name must be
pointing to a valid query
is not defined and qryCustomer.allareas is true:
#iif(qryCustomer.allareas, 'All Areas' , '#ValueList(qryAreas.name,',
')#' )#
-Original Message-
From: Joe Eugene [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 6:32 PM
To: CF-Talk
Subject: Re: iif usage
Carefully note
On Sunday, September 8, 2002, at 02:24 , Ruslan Sivak wrote:
Hi, I'm having a problem with iif.
Don't use it. If you used cfif, you wouldn't be having these problems. You'
ve got a boolean test and you set a string value which you then test later
(why not just use the same test or at least use
[EMAIL PROTECTED]
Sent: Sunday, September 08, 2002 7:45 PM
Subject: RE: iif usage
That's the whole point, Joe... I have the following code above it
cfif not qryCustomer.allareas
cfquery name=qryAreas datasource=#request.dsn#
somequery
/cfquery
/cfif
So therefore, qryAreas.name will only
Iif is necessary in certain cases. Last time I checked, you can't use
cfif inside other cf tags... (Maybe in mx you can).
Russ
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 8:48 PM
To: CF-Talk
Subject: Re: iif usage
On Sunday
Iif is necessary in certain cases.
I can't think of a single case in which it's necessary. It's just another
way to perform conditional logic. If you have one way to perform conditional
logic, you can do anything you need, although it might be clumsier in some
situations than an alternative
IIF is never necessary.
-Original Message-
From: Ruslan Sivak [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 08, 2002 9:45 PM
To: CF-Talk
Subject: RE: iif usage
Iif is necessary in certain cases. Last time I checked, you can't use
cfif inside other cf tags... (Maybe
On Sunday, September 8, 2002, at 08:45 , Ruslan Sivak wrote:
Iif is necessary in certain cases.
No it isn't.
Last time I checked, you can't use
cfif inside other cf tags... (Maybe in mx you can).
You can always restructure such code to not need 'iif()'.
Sean A Corfield --
: Monday, September 09, 2002 12:17 AM
Subject: Re: iif usage
On Sunday, September 8, 2002, at 08:45 , Ruslan Sivak wrote:
Iif is necessary in certain cases.
No it isn't.
Last time I checked, you can't use
cfif inside other cf tags... (Maybe in mx you can).
You can always restructure
At 1/25/2001 06:13 PM +, Stephen Moretti wrote:
snip
Cfoutput#iif(isDefined("Attributes.display"),Trim(attributes.name"_query.
"attributes.display),DE(''))#/cfoutput
This is good advice, and it will also not throw any errors if attributes.display is
not defined. For example:
IIf(
Ruslan,
I'm using iif, and running into some weird things. Well first of all I'm
generating CF on the fly, so I need to escape # so that the
variables don't
get evaluated until they are in the generated file. For example I'm using
something like this. Is this the right way to do it or
I think you have 2 too many #'s in there. You can also try
#iif(isDefined("Attributes.display"),DE(RTrim("#Chr(35)##attributes.name#_qu
ery.#
attributes.display##Chr(35)#")),DE(""))#
Chr(35) = #
Blessed Be,
--Katrina Chapman
http://www.katrinachapman.com
http://www.cfchick.com
-Original
23 matches
Mail list logo