I'm having a brain freeze on the differences between how CFIF and CFSWITCH statements
are handled.
How I understand it: CFSWITCH evaluates all expressions "independently" (i.e. with no
regard to other CFCASE values) while CFIF evaluates expressions serially (i.e. from
first to last). Is this statement true? Here's the reason I'm asking.
First off, I'm doing this logic inside of a CFSCRIPT block, not that it should make
any difference.
I have this script:
<cfscript>
IF (CGI.script_name CONTAINS "/default.cfm") {
ad.category = "1";}
ELSE IF (CGI.script_name CONTAINS "/directory/default.cfm") {
ad.category = "2";}
ELSE IF (CGI.script_name CONTAINS "/directory/subdirectory/default.cfm") {
ad.category = "3";}
ELSE
ad.category = "0";
</cfscript>
In this example, If I am on /directory/default.cfm, "2" should be set as the
ad.category value and not "1", correct? I just want to make sure that my assumptions
are safe before I go too much further on this.
Thanks,
Pete
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com