Isn't CASE 2, condition C True? ie. index.cfm NEQ page.cfm

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 25, 2005 11:41 AM
To: CF-Talk
Subject: RE: cfif with AND and OR statements


A = isDefined("url.ItemNumber")
B = URL.ItemNumber NEQ 12345
C = CGI.SCRIPT_NAME NEQ '/page.cfm'

CASE 1
url.itemNumber UNDEFINED
CGI.ScriptName = 'page.cfm'

IF (A AND B) OR C
IF (F AND F) OR F
IF F OR F
FALSE Clause Run

CASE 2
url.itemNumber = 12345
cgi.ScriptName = 'index.cfm'

IF (A ND B) OR C
IF (T AND F) OR F
IF F OR F
FALSE Clause Run

Is this not the result you are getting?  Is this not the result you are
expecting?

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

"C code. C code run. Run code run. Please!"
- Cynthia Dunning

.....-----Original Message-----
.....From: Cameron Johnson [mailto:[EMAIL PROTECTED]
.....Sent: Wednesday, May 25, 2005 8:23 AM
.....To: CF-Talk
.....Subject: cfif with AND and OR statements
.....
.....I've got the following cfif statement in one of my header pages:
.....
.....<cfif (isDefined("URL.ItemNumber") AND URL.ItemNumber NEQ 12345) OR
.....(CGI.SCRIPT_NAME NEQ '/page.cfm')>
.....show table 1
.....<cfelse>
.....show table 2
.....</cfif>
.....
.....Here are my scenarios:
.....
.....- when the cfif is combined into one statement, it works correctly
.....(meaning I see table 2) when browsing to /page.cfm. But it doesn't work
.....when browsing to index.cfm?ItemNumber=12345
.....
.....- if I split the statement into two cfif statements, I see table 2 on
.....both /page.cfm and index.cfm?ItemNumber=12345
.....
.....Any ideas why it's not working on index.cfm?ItemNumber=12345 when the
.....statement is combined? Is something wrong with the cfif that I'm not
.....seeing?
.....
.....Appreciate the help.
.....
.....- Cameron
.....
.....



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:207660
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to