, the first argument
in the IIF() function evaluates to false (both conditions are false) so only
the third argument, De(), should be evaluated. However, for some reason,
both the second and third arguments are being evaluated and I'm getting an
error message that Element NICKNAME is undefined
Dave Watts wrote:
cfset variables.nickname = Iif( (arguments.nicknameInd NEQ 0) AND
(IsDefined(importData.nickname)),
De(importData.Nickname), De())
CF is going to verify that the variable exists, because you're referring to
it.
That's what's happening here. Just because you're using
, the first
argument in the IIF() function
evaluates to false (both conditions are false) so only the third argument,
De(), should be evaluated. However,
for some reason, both the second and third arguments are being evaluated and
I'm getting an error message
that Element NICKNAME is undefined
) and a series of
indicators (nicknameInd) that indicate if the value from the query should
be used (indicator = 1) or not (indicator = 0). In the below code, the
first argument in the IIF() function evaluates to false (both conditions
are false) so only the third argument, De(), should be evaluated.
However
Thanks Russ (and Dave).
That's the route I ended up going to. Kind of annoying as I think the Iif()
method produces cleaner code (and I had already written it) but it is what it
is.
--
Mosh Teitelbaum
Russ Michaels wrote
If you are going to use a variable that doesn't exist then using
cfset variables.nickname = Iif( (arguments.nicknameInd NEQ 0) AND
(IsDefined(importData.nickname)),
De(importData.Nickname), De())
CF is going to verify that the variable exists, because you're referring to
it.
That's what's happening here. Just because you're using the DE
Well if you want to try it out then try using nested evaluate(de(''))
You can also achieve same using nested quotes like de('stuff') to avoid
evaluation,
But it just gets messy imho
Iif() has its uses for simple inline evaluations, such as select lists or
dynamic style classes but beyond that I
cfquery datasource=askseaton name=get_offices1 result=log
select s.office_name,u.userid,s.lead_mgr,iIf(u.userid = s.lead_mgr,
u.first , s.lead_note ) as leadMgr
from sourcebook_1 s ,user_info u
where s.active = 1
and office_id not in(36,37,38,73)
order
IIF is a ColdFusion method, you can't use it in SQL like that. What you're
probably looking for is CASE:
CASE WHEN u.userid = s.lead_mgr THEN u.first ELSE s.lead_note END AS leadMgr
Francois Levesque
http://blog.critical-web.com/
On Mon, Jul 20, 2009 at 9:31 AM, RamaDevi Dobbala ramadobb
ya my case should be like that, but i need to pass that result to the cfgrid,
along with some ohter rows
IIF is a ColdFusion method, you can't use it in SQL like that. What you're
probably looking for is CASE:
CASE WHEN u.userid = s.lead_mgr THEN u.first ELSE s.lead_note END AS leadMgr
On Wednesday 09 Jan 2008, Ian Skinner wrote:
I'm having trouble with this and the usual tricks don't seem to be working.
#iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))#
Why not just rewrite it so as not to use iif or de ?
--
Tom Chiverton
Helping to administratively architect
I'm having trouble with this and the usual tricks don't seem to be working.
#iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))#
This fails. I have tried escaping the internal hash character by
doubling. I have tried to concatenate chr(35). Everything I do throws
exceptions involving
: Outputting a hash character in an IIF() function.
I'm having trouble with this and the usual tricks don't seem
to be working.
#iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))#
This fails. I have tried escaping the internal hash character
by doubling. I have tried
Tom Chiverton wrote:
On Wednesday 09 Jan 2008, Ian Skinner wrote:
I'm having trouble with this and the usual tricks don't seem to be working.
#iif(bgFlag,DE(' style=background-color: #DDFFDD'),DE(''))#
Why not just rewrite it so as not to use iif or de ?
Generally because I prefer
Dave wrote:
Have you tried assigning it to a variable in a cfset and then displaying the
variable. Alternately, convert to RGB: style=background-color:rgb(221 255
221)'
Yes I can set and use a variable, but I was curious why I would have to
do this. Why do I need to create five lines to set
{
bar=b
}
b
seems clearer to me than nested iif and de.
--
Tom Chiverton
Helping to revolutionarily orchestrate B2B experiences
on: http://thefalken.livejournal.com
This email is sent for and on behalf of Halliwells LLP.
Halliwells
The hash simply needs to be escaped as
#iif(bgFlag,DE(' style=background-color: DDFFDD'),DE(''))#
The hash needs to be escaped twice since you are delaying evaluation.
The text:
style=background-color: DDFFDD
Is passed out of the de function as (including the quotes):
style
a hash mark in an iif. (which I answered in my
previous reply.
~Brad
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Brad Wood wrote:
The hash simply needs to be escaped as
#iif(bgFlag,DE(' style=background-color: DDFFDD'),DE(''))#
The hash needs to be escaped twice since you are delaying evaluation.
The text:
style=background-color: DDFFDD
Is passed out of the de function as (including
Tom Chiverton wrote:
if (foo){
bar=a
}else{
bar=b
}
b
seems clearer to me than nested iif and de.
This is completely personal preference and a very very small matter.
But I generally find less to be clearer then more.
--
cfscript
if (foo) {
bar='a';
} else
cfscriptif (foo) {bar='a';} else {bar='b';}/cfscriptuse_number #bar#
Now it's one line... who didn't see that coming? :-P
..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
~|
Adobe® ColdFusion® 8 software 8
Hello, all,
I have this code snippet below which runs fine on my local workstation
(Windows XP, CF 8 IIS 5.1). When I throw it up on our dev server
(Windows 2k3, IIS 6, CF 7) I get an index out of bounds error on the
second IIF line below. I've looked at the docs and I don't see why
this code
cfset uploadFile(
IIF(Len(Trim(form.txtFileName)) GT 0,
Evaluate(DE(ListGetAt(form.txtFileName,
intCounter))), ), ...
Why are you using DE inside Evaluate? The point of the DE (Delay Evaluation)
function is to prevent the automatic evaluation that occurs within IIF.
Dave Watts, CTO, Fig
I'm assuming there is a noticeable difference in using IFF? Recently I've been
using it quite heavily in forms now i.e.
cfinput type=radio name=myField id=myField value=myValue
checked=#IIF(something eq 'somethingelse', DE('Yes'), DE('No'))# /
Are there better ways of doing
=radio name=myField id=myField value=myValue
checked=#IIF(something eq 'somethingelse', DE('Yes'), DE('No'))# /
Are there better ways of doing this?
~|
Create Web Applications With ColdFusion MX7 Flex 2.
Build powerful
First better way: Don't use strings for booleans!
cfinput type=radio name=myField id=myField value=myValue
checked=#IIF(something eq 'somethingelse', 1, 0)# /
Second better way: Don't write if True then True else False!
cfinput type=radio name=myField id=myField value=myValue
checked
I have never really used iif before, I was aware it existed but didn't
really see a good place for it. Until today. =)
Check this out:
dollarformat(iif(Cost, cost, 0))
That says, evaluate cost as a Boolean, if its true (anything but 0 or
null) then return cost, otherwise return 0 (so
Uh oh. You're probably about to get hammered with responses related to the
performance cost...
On 3/22/07, Peterson, Chris [EMAIL PROTECTED] wrote:
I have never really used iif before, I was aware it existed but didn't
really see a good place for it. Until today. =)
Check this out
Here come the Iif police.
-Original Message-
From: Peterson, Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 3:10 PM
To: CF-Talk
Subject: Just a tidbit for those who might not have use iif before
I have never really used iif before, I was aware it existed but didn't
and about whether Cost is truly a Boolean...
-Original Message-
From: Rob Wilkerson [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 3:15 PM
To: CF-Talk
Subject: Re: Just a tidbit for those who might not have use iif before
Uh oh. You're probably about to get hammered
Quick, someone find a way to make that need an evaluate().
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 4:17 PM
To: CF-Talk
Subject: RE: Just a tidbit for those who might not have use iif before
Here come the Iif police.
-Original
dollarformat(iif(Cost, cost, 0))
You could also use the val() function around the cost variable to do the
same thing more efficiently. It will also correct for unexpected
non-integer characters in the variable as well. I've found that in
almost any situation where iif() looks like it's needed
I think I heard something about them going back on tour this year...
On 3/22/07, Andy Matthews [EMAIL PROTECTED] wrote:
Here come the Iif police.
-Original Message-
From: Peterson, Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 22, 2007 3:10 PM
To: CF-Talk
Subject: Just
I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.
I've got a radio button in a form. I want to make sure that button is there,
and if so use it's value. It it's not there then I want the string N:
IIf(NOT
StructKeyExists(FORM
IIf(StructKeyExists(FORM, listing_openhouse),
'Trim(FORM.listing_openhouse)', 'N')
*should* do it :)
On 07/12/06, Andy Matthews [EMAIL PROTECTED] wrote:
I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.
I've got a radio button
second argument. Before the
function is processed, the trim function will run and the
Trim(FORM.listing_openhouse) will be replaced with text. If this is 'true' then
the result of the trim will be treated as a variable, not as a value. I'd
rewrite the function as:
IIf(NOT StructKeyExists(FORM
--//-
-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 07, 2006 9:48 AM
To: CF-Talk
Subject: Re: Using Iif and De together...
Two points. The first is that any variable or function used in the last 2
arguments will be evaluated both before and after the tag
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 07, 2006 11:49 AM
To: CF-Talk
Subject: Using Iif and De together...
I KNOW that I've used this method successfully before, but for some reason
it's not working correctly now.
I've got a radio button
This always makes me laugh.
Why don't you make a page with CFIF, then run it
Now use IIF() and run it
What difference do you see in execution time? Bugger all.
If you make a big loop that calls IIF 1000 times then you may notice a
difference.
Also imagine this code
select name = bob #IIF
I've seen debates around this so many times I decided to blog it:
http://blogs.sanmathi.org/ashwin/2006/07/24/whento-evaluate-and-iif/
In summary - evaluate() and iif() will perform well when the expressions
being evaluated remain static, since the Java classes that are compiled
to process
Well we all know what the industry standard has been, but it seems that in
real world tests, iif is faster then cfif in some instances, and arguably
more readable (especially if you're using it inside a select or
radio/checkbox.
Russ
-Original Message-
From: Mike Soultanian [mailto
Looks like that works... and for large values of X, looks like this method
is the fastest, followed by iif with DE, followed by cfif. Does this mean
that it's no longer true that iif is not efficient? If I'm using it only a
few times on a page, and it's a little slower then cfif, I don't really
understand how.
cfset fieldlist =
Customer_ID,FirstName,LastName,Email,Address1,Address2,City,State,State2,Zip,Country,Phone
cfloop list=#fieldlist# index=i
cfset temp = iif(didquery and didfind, getCust.#i#, DE())
cfparam name=attributes.#i# default=#temp#
/cfloop
What I don't get is how iif
.
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 4:22 PM
Here's how I understand iif: If the condition is true,
return the 2nd
parameter, otherwise return the 3rd.
So in your example, if (didquery and didfind) returns true, the code
cfif didquery and didfind
cfset temp = variables[getCust][i]
cfelse
cfset temp =
/cfif
Does the same thing right?
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 4:43 PM
To: CF-Talk
Subject: RE: iif: am I understanding
, 2006 3:00 PM
cfif didquery and didfind
cfset temp = variables[getCust][i]
cfelse
cfset temp =
/cfif
Does the same thing right?
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 4:43 PM
To: CF-Talk
Subject: RE: iif
This part of the app is not going to take heavy traffic, so the performance
hit would be negligible. However going forward I will always take into
consideration the possible performance implications of iif/evaluate/DE.
Ben -- I guess I like messing around with stuff like this (iif, evaluate
Josh,
I am right with you on that point! I am a huge fan of learning by doing!
Keep it up.
...
Ben Nadel
www.bennadel.com
-Original Message-
From: Josh Nathanson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 21, 2006 6:10 PM
To: CF-Talk
Subject: Re: iif: am I
This part of the app is not going to take heavy traffic, so
the performance
hit would be negligible. However going forward I will always
take into
consideration the possible performance implications of
iif/evaluate/DE.
Yeah, and another thing to keep in mind when memorizing things
On Friday 02 June 2006 23:20, Jim McAtee wrote:
cfquery datasource=#dsn#
INSERT INTO cctransactions (
name,
response
)
VALUES (
'#form.name#',
'#IIf(StructKeyExists(authresponse, http_response),
authresponse.http_response,
DE())#'
)
/cfquery
VALUES
I'm working in CF5. I thought single quotes within strings were always
escaped in a cfquery. I have a query using an IIf() in the value and this
doesn't appear to be the case. Does this have something to do with how
I'm doing the evaluation of the second argument in the IIf() below
It used to be, but is not so anymore, that IIF() was slower than
cfifcfelse/cfif.
It also used to be true, although I don't think it is any more, that all
of the expressions in an IIF() are evaluated even if not used. Not true
of cfif.
I know in older versions this would cause an error:
#iif
Hi all,
Am I correct in saying that the IIf function and the cfif tag work
differently on the following scenerio. In the CFIF tag, when the CFIF fails it
will jump over the code which follows until a CFELSEIF, CFELSE or CFIF.
Here's an example:
--
CFIF
The cfif failed so this text
IIF() is shorthand replacement for IF/THEN/ELSE. Other langs have
IIF() too, eh?
Thus
cfif foo IS 5
foo is 5
cfelse
foo is not 5
/cfif
is equivalent to
IIF(foo IS 5, 'foo is 5', 'foo is not 5')
*note...mind the quotes! ' is double quote followed by single quote
DK
On 5/1/06, Matthew
Mingo Hagen wrote:
no quotes in the first argument.
thanks everyone.. the quotes were the issue.
Rick
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237846
Archives:
I always have trouble using IIF...
Why doesn't this work?
cfset request.dirsep = iif(lcase(server.os.name) contains
'windows',de(/),de(\))
It gives me this error:
Parameter validation error for function IIF.
The value of the parameter 1, which is currently lcase(server.os.name)
contains
Try this:
cfset request.dirsep =
iif(FindNoCase(windows,server.os.name),de(/),de(\))
Al Everett (Contractor)
DIGICON Corporation
National Institute of General Medical Science
Information Resources Management Branch
[EMAIL PROTECTED]
301.594.4082
-Original Message-
From: Rick Root
cfset request.dirsep = iif(lcase(server.os.name) contains
'windows','/','\')
try that, eh?
Also, no need for DE(), just use all teh quotes luke! ' foo ' like that
DK
On 4/14/06, Rick Root [EMAIL PROTECTED] wrote:
I always have trouble using IIF...
Why doesn't this work?
cfset
iif(
lcase(server.os.name) contains 'windows',
de( \ ),
de( / )
)
no quotes in the first argument.
--
Met vriendelijke groet / Kind regards
Mingo J. Hagen.
E-Line Websolutions B.V.Herenweg 160
2101 MT Heemstede
phone: +31620 775444
fax: +3123 5471920
fax [mingo]: +3184
]
Sent: Friday, April 14, 2006 7:02 AM
To: CF-Talk
Subject: IIF help
I always have trouble using IIF...
Why doesn't this work?
cfset request.dirsep = iif(lcase(server.os.name) contains
'windows',de(/),de(\))
It gives me this error:
Parameter validation error for function IIF.
The value
I always run into this, and I've probably come across a solution, but
forgotten it. In an IIf() I can easily return the value of a varible by
surrounding it in quotes, or return a literal by using DE(), but how to
use both? What would be the correct syntax to use in the first argument
to IIf
cfset a = loc.address IIf(Len(loc.city), DE(, #loc.city#) , DE())
On 1/9/06, Jim McAtee [EMAIL PROTECTED] wrote:
I always run into this, and I've probably come across a solution, but
forgotten it. In an IIf() I can easily return the value of a varible by
surrounding it in quotes, or return
I am using the CF report builder and having a tough time with a
conditional statement.
What I want to achieve is a field on the report that says either C or
FFS
What I want this to say is... If #query.capdate is before January 1,
1900, show FFS, otherwise show C
How do I make this work on the
Due to the double evaluation nature of IIF, you have to double escape text
results in IIF. For example:
IIF(1 eq 1, 'one', 'not one')
What you see there is single quotes around double quotes. This can also be
done with the DE() function, but that's a waste in my mind.
http
dear all
is there a way of doing the following in a query to MSSQL like you can
to access?
SELECT field1, field2, iif(field1 = field2,'same','different') AS mynote
FROM mytable
WHERE etc
I appreciate it could be done in a SP or by analysing the output but in
this case it is easier
is there a way of doing the following in a query to MSSQL like you can
to access?
SELECT field1, field2, iif(field1 = field2,'same','different') AS mynote
FROM mytable
WHERE etc
I appreciate it could be done in a SP or by analysing the output but in
this case it is easier not to...
Check
Richard Meredith-Hardy wrote:
is there a way of doing the following in a query to MSSQL like you can
to access?
SELECT field1, field2, iif(field1 = field2,'same','different') AS mynote
FROM mytable
WHERE etc
Look up the CASE .. WHEN .. THEN blabla statement. Maybe even
Access
http://www.extremeexperts.com/sql/faq/IIForDecode.aspx
- Original Message -
From: Richard Meredith-Hardy [EMAIL PROTECTED]
Date: Mon, 20 Sep 2004 10:36:13 +0100
Subject: iif in MSSQL
To: CF-Talk [EMAIL PROTECTED]
dear all
is there a way of doing the following in a query to MSSQL like
Perfect.Thankyou!
--
Regards;
Richard Meredith-Hardy
-
r[dot]mh[at]flymicro[dot]com
Tel: + 44 (0)1462 834776 FAX: + 44 (0)1462 732668
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations
finding is that Quickbooks needs the import data to be in the Inuit Info
File (I think that is what it stands for), or .iif format.Research on an
iif file seems to show that it is just another version of a csv file.Has
anyone in here ever exported from a db to Quickbooks before?I know how
: Quickbooks IIF files???
I am currently building a timesheet application for my company, which is
pretty simple.My boss wants me to save her some time by being able to
take all the data that I am collecting from the employees and import it
into Quickbooks.I have been google-ing this for the past hour
You are correct - the iif file is pretty much a comma delimited ascii file. The
answer you need is actually in the quickbooks help files - here's an excerpt.
-Mark
---
You may also want to refer to the Reference Guide to Import Files
Note
Thanks to both of the Mark's...
I will try out the second solution.
Sometimes you just gotta know where to look for the right info!
Ray
At 01:51 PM 8/23/2004, you wrote:
You are correct - the iif file is pretty much a comma delimited ascii
file. The
answer you need is actually
I was having some issues on IIF and thought I was using it correctly so I reverified it by looking at the examples in the book and if I copy an example directly out of the docs, it doesn't work. Try this in CFMX 6.1 #IIf(IsDefined(Form.Deliver), Evaluate(DE(Form.Deliver)), DE(no))#
That should
I correct myself, the example works, but what I'm trying to do doesn't work. Can anyone look at this and see why it isn't working
#iif(listlen(cgi.query_string, ) gt 1, Evaluate(DE(listdeleteat(listdeleteat(cgi.query_string, 1, ), 1, =))), DE(test))#
The cgi query_string will have either
I was having some issues on IIF and thought I was using it
correctly so I reverified it by looking at the examples in
the book and if I copy an example directly out of the docs,
it doesn't work. Try this in CFMX 6.1
#IIf(IsDefined(Form.Deliver), Evaluate(DE(Form.Deliver)),
DE
:45
To: CF-Talk
Subject: Re: IIF doesn't work correctly
I correct myself, the example works, but what I'm trying to
do doesn't work. Can anyone look at this and see why it isn't working
#iif(listlen(cgi.query_string, ) gt 1,
Evaluate(DE(listdeleteat(listdeleteat(cgi.query_string, 1
I figured it out, must not put double quotes.
Bob
I correct myself, the example works, but what I'm trying to do doesn't
work. Can anyone look at this and see why it isn't working
#iif(listlen(cgi.query_string, ) gt 1,
Evaluate(DE(listdeleteat(listdeleteat(cgi.query_string, 1, ), 1
Help:
#IIF(StructKeyExists(struct, 'keyname'),DE(struct.keyname),DE('no
key'))#.fails if the key is not present.
BUT,
cfif StructKeyExists(struct, 'keyname')
#struct.keyname#
cfelse
no key
/cfif
doesn't.
Am I missing something about IIF() and DE()? It looks as if both DE
try quotes around the argument passed to DE.
DE(struct.keyname) should be DE('struct.keyname')
mike
-Original Message-
From: Alexander Sherwood [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2003 2:36 PM
To: CF-Talk
Subject: IIF() and IsDefined()
Help:
#IIF(StructKeyExists(struct
you don't need the de() call around the variable name, just put it in
quotes:
iif(structKeyExists(struct, keyname), struct.keyname, de(no key))
Your code was trying to output a variable with a name equal to the value
stored in #struct.keyname#, which isn't what you wanted.
Usually, using CFIF
someone here can give
a good example of a null check added to a cfqueryparam ... Any takers?
#Iif(not StructKeyExists(values[i], proximity), DE(null), '
values[i][proximity] '))#
Thanks!
~|
Archives: http
I don't think you can use IIF in this case as IIF has
a habit of evaluating both results regardless of
whether it resolves to true or false. Even if
proximity doesn't exist, it will still evaluate
values[i][proximity].
Yeah, that's how it's starting to look. Well, thanks for the
confirmation
dont have time to test, but would it not need to something like this???
#Iif(not StructKeyExists(values[i], proximity), DE(null),
DE(values[i][proximity])))#
You would then need to check the value and decide whether quotes would work
Could be wrong... my 2 secs worth
-Original
I don't think you can use IIF in this case as IIF has
a habit of evaluating both results regardless of
whether it resolves to true or false. Even if
proximity doesn't exist, it will still evaluate
values[i][proximity].
Cheers
I've got an array of structures and am looping
through them
by apostrophes?
#Iif(not StructKeyExists(values[i], proximity), DE(null), '
values[i][proximity] '))#
Thanks!
--
Aidan Whitehall [EMAIL PROTECTED]
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd +44 (0)1695 51775
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
I agree with Sean. IIF is slow and can ALWAYS be avoided.
I'm very fond of using the following syntax as Sean pointed out, except that
I use style sheet classes instead of arrays:
cfset theMod = currentRow MOD 2
td class=alternateRowColor#theMod#
..
/td
IIF screws up the color coding
Good (humor) Sean...~! 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...
Joe
- Original Message -
From: Sean A Corfield [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent
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
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.
All languages have their fans in terms of language specifics and what to use and what
not to use... if you do not like something, don't use it. If you
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
Hi, I'm having a problem with iif.
If I do
#iif(qryCustomer.allareas,DE(All
Areas),DE(#ValueList(qryAreas.name,', ')#))#
and qryCustomer.allareas is true, therefore qryAreas is undefined (I
check for it with an cfif somewhere else), then I get an error
Parameter 1 of function ValueList which
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
#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 name
Russ
-Original Message-
From: Joe Eugene [mailto:[EMAIL PROTECTED]]
Sent: Sunday
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
Carefully note the usage of single and double quotes.. there are there for a
reason!
and make sure... u have the query.columnName.. u are pointing..to
#IIF(qryCustomer.allareas, 'All Areas' , '#ValueList(qryAreas.name,',')#'
)#
Joe
- Original Message -
From: Ruslan Sivak [EMAIL
have commented out the cfif above, so that the query runs in
either case, but I'd still like to know how to get the iif to work the
way I want it to.
Russ
P.S. Yes, sorry about missing the single quotes in the middle. I have
the following code now, but still has the same problem if the qryAreas
1 - 100 of 226 matches
Mail list logo