Title: Stupid idea?
Taco,
 
Maybe a bit more of where your heading would be in order here. I can assume what your trying to do with the function output, but am not 100% sure.
 
I take it this is along the lines of your custom error handling?
 


Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485  -  Fax: 03 9699 7976  

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Taco Fleur
Sent: Thursday, 1 July 2004 11:14 AM
To: CFAussie Mailing List
Subject: [cfaussie] Stupid idea?

Lets see if this one can start a global cf war..

I had this idea/thought and like always its probably a stupid one, so I thought lets post it to the list and see what all the real experts have to say about it.

I want more control on what happens when there is an error, for example I want to have a choice when I output something like #insignicantVariable# to display

[Error] to the user, nothing or fail.

#obj.fnOutput( variables, 'firstName', 'fail' )#

Now tell me, how stupid is this and why?

<cfcomponent displayname="Output"
        hint="">

        <!--- ***************** Function ***************** --->
        <cffunction access="public"
                name="fnOutput"
                output="true"
                returntype="void"
                displayname=""
                hint="">

                <cfargument name="scope"
                        type="struct"
                        required="true"
                        displayname="Scope">
                <cfargument name="identifier"
                        type="string"
                        required="true"
                        default="variables"
                        displayname="Scope">
                <cfargument name="onError"
                        type="string"
                        required="true"
                        default="display"
                        displayname="On Error">

                <cftry>
                        #arguments.scope[ arguments.identifier ]#
                        <cfcatch type="any">
                                <cfswitch _expression_="#arguments.onError#">
                                        <cfcase value="display">
                                                [Error]
                                        </cfcase>
                                        <cfcase value="nothing"></cfcase>
                                        <cfcase value="fail">
                                                <cfthrow message="#cfcatch.message#"
                                                        type="Custom"
                                                        detail="#cfcatch.detail#">
                                        </cfcase>
                                        <cfdefaultcase><!--- This should never happen ---></cfdefaultcase>
                                </cfswitch>
                        </cfcatch>
                </cftry>

        </cffunction>

</cfcomponent>

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
Register now for the 3rd National Conference on Tourism Futures, being held in Townsville, North Queensland 4-7 August - www.tq.com.au/tfconf
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to