Guess what...
Try it you'll like it! I don't see anything that wouldn't work about that
syntax, just give it a spin. The only observation I would make is that you
have to make sure that both conditions are universal qualifiers for any
subsequent nested statements. The following two statements would be
identical and the former would seem pointless. Also "IS" is faster to type
than "EQ". :-)
1. <cfif mTEST1 IS "ABC" AND mTEST2 IS "DEF">
Do something spectacular
</cfif>
<cfif mTEST1 IS "ABC" AND mTEST2 IS "XYZ">
Do something stupid
</cfif>
2. <cfif mTEST1 IS "ABC">
<cfif mTEST2 IS "DEF">
Do something spectacular
<cfelseif mTEST2 IS "XYZ">
Do something stupid
</cfif>
</cfif>
I like to eliminate redundancy wherever possible (call me chainsaw Al). Be
sure to check for the existence of the variable first (if it's not a cfset)
or set a default with <cfparam...>
Later,
Tim Fields
Allaire Uncertified ColdFusion Developer
Member, TeamAllaireBench
-----Original Message-----
From: Arden Weiss [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 09, 2001 11:15 PM
To: CF-Talk
Subject: Multiple conditions in a single CFIF statement.
So far I've only used single <CFIF statements - hence don't know syntax for
multiple conditions and haven't been able to find an example in the books I
have.
Can someone give me a hint or example of the CF syntax to do state the
following condition:
<CFIF mTEST1 EQ "ABC" AND mTEST2 EQ "DEF">
without using nested <CFIF statements???
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists