> I am writing UDF's on MX using <cffunction>, and I would like 
> to know what 
> the best way to create local variables for use inside my 
> functions that will 
> not interfere with variables in the caller's scope.

The only and only way is with the var scope. Simply do:

<cffunction ...>
        <cfargument ....>
        <cfset var x = 1>
        <cfset var y = 2>

Be sure to remember that the cfquery tag, if used with name="", also
creates a variable. If I use a query in a cffunction tag, I'll typically
do:

        <cfset var theQuery = "">

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc

Email    : [EMAIL PROTECTED]
WWW      : www.camdenfamily.com/morpheus
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to