LOL,

Choose whatever floats your boat ;-) I find an inline if more efficient but
a cfif is just as good.


-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED] 
Sent: 03 March 2005 16:11
To: CF-Newbie
Subject: RE: change font color based on content

This floated my boat for all of 5 minutes:

<cffunction name="RightWayWrongWay" output="no" returntype="string">

        <cfargument name="status" required="yes" type="string">
        <cfargument name="who" required="no" default="adrian" type="string">

        <!--- The right way --->
        <cfif ARGUMENTS.who EQ "adrian">

                <cfif ARGUMENTS.status EQ "OFFLINE">
                        <cfreturn "red">
                <cfelseif ARGUMENTS.status EQ "ONLINE">
                        <cfreturn "green">
                </cfif>

        <!--- Neil's way! --->
        <cfelseif ARGUMENTS.who EQ "neil">

                <cfreturn IIf(yourQuery.Status EQ ARGUMENTS.status,
DE("Green"),
DE("Red"))>

        <cfelse>

                <cfreturn "Don't use Neil's way!!!">

        </cfif>
This e-mail is from Reed Exhibitions (Oriel House, 26 The Quadrant,
Richmond, Surrey, TW9 1DL, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions.
Visit our website at http://www.reedexpo.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:15:721
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to