You must *create* a specialNumber to pass in as an argument of type
specialNumber:

x = CreateObject("component","specialnumber").specialNumber(6);
y = CreateObject("component","test").yaddaDoodle(x);

-- 
Eric C. Davis
Programmer/Analyst I
Georgia Department of Transportation
Office of I.T. Applications
Web Applications Group
404.463.2860.199
[EMAIL PROTECTED]


-----Original Message-----
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 08, 2004 11:07 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Custom argument types


Specialnumber.cfc
<cfcomponent>
        <cffunction name="specialNumber" access="public"
returntype="any">
                <cfargument name="theNumber" required="yes"
type="numeric">
                
                <cfset var specialNumberReturn=false>
                <cfscript>
                        if(arguments.theNumber gt 5)    {
                                specialNumberReturn=true;
                        }
                </cfscript>
                
                <cfreturn this>
        </cffunction>
</cfcomponent>

Test.cfc

<cfcomponent>
        <cffunction name="yaddaDoodle" access="public"
returntype="boolean">
                <cfargument name="theSpecialNumber" required="yes"
type="specialNumber">
        
                <cfreturn arguments.theSpecialNumber>
        </cffunction>
</cfcomponent>

yaddaDoodle(6) and yaddaDoodle('fred') both return error.


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to