Except for one problem this code is perfect.
Don't use ParameterExists(). Use IsDefined("") instead.
--K
-----Original Message-----
From: Adrian J. Moreno [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 6:40 PM
To: CF-Talk
Subject: Re: iif with 3 expressions?
If I understand your problem,
1. you want to check for the existence of a variable
2. If the variable exists, then check against multiple values
3. display different HTML depending on value of variable
<cfif ParameterExists(someVariable)> <!--- check for var existence --->
<cfswitch expression="#someVariable#"> <!--- var exists, check for
value --->
<cfcase value="1">
<img src="one.gif"> <!--- display HTML based on value --->
</cfcase>
<cfcase value="2">
<img src="two.gif">
</cfcase>
<cfcase value="3">
<img src="three.gif">
</cfcase>
<cfdefaultcase>
<img src="other.gif"> <!--- in case value wasn't in expected
list --->
</cfdefaultcase>
</cfswitch>
</cfif>
CFSWITCH is much faster than multiple CFIF statements and you can always
make allowances for more and more cases as
need be.
HTH,
Adrian J. Moreno
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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