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

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

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

Reply via email to