Just to be anal - you CAN have mutually exclusive arguments - but you
have to run the code yourself. For example:

<cffunction name="foo" returnType="string" access="public">
        <cfargument name="alpha" type="numeric" required="false">
        <cfargument name="beta" type="numeric" required="false">

        <cfif isDefined("alpha") and isDefined("beta")>
                <cfthrow You get the idea



========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

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

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

> -----Original Message-----
> From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, May 28, 2003 2:53 PM
> To: CF-Talk
> Subject: RE: CFC and private function
> 
> 
> You can't have mutually exclusive arguments.  If one argument 
> is a string, and one is a number, you can do this:
> 
> <cffunction name="myfunc">
>    <cfargument name="arg" />
> 
>    <cfif isNumeric(arg)>
>       <!--- it's a number --->
>    <cfelse>
>       <!--- it's a string --->
>    </cfif>
> </cffunction>
> 
> However, I'd recommend having two functions, categoryIDExists 
> and categoryNameExists to remove all ambiguity from the 
> function call and what it is supposed to do.
> 
> ---
> Barney Boisvert, Senior Development Engineer
> AudienceCentral (formerly PIER System, Inc.) 
> [EMAIL PROTECTED] voice : 360.756.8080 x12
> fax   : 360.647.5351
> 
> www.audiencecentral.com
> 
> > -----Original Message-----
> > From: Cedric Villat [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, May 28, 2003 1:15 PM
> > To: CF-Talk
> > Subject: CFC and private function
> >
> >
> > I want to call a private function inside my CFC. All the books say 
> > that I can use a private function like any other built-in function, 
> > such as:
> >
> > <cfif CategoryExists(CategoryName)>
> >
> > The CategoryExists function has 2 arguments, either the ID or the 
> > Name. If I want to use the above syntax to check for the Name, how 
> > would I do that? I've tried something like:
> >
> > CategoryExists("", CategoryName)
> >
> > but my function requires that the 2 arguments are mutually 
> exclusive. 
> > If tried
> >
> > CategoryExists( , CategoryName)
> >
> > but that doesn't make much sense. Basically, how can I specify just 
> > the Name argument without defining the ID argument?
> >
> > Cedric
> > 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to