Good Morning,
That's exactly what I determined. The way CF handles
variables as a standard cfm file verses a cfc
component is what threw me off. Thanks for your input,
have a great day.
--- Kevin <chornobyl@...> wrote:
> It looks like the function ones() is not returning
> anything.
>
> It needs a variable to return.
>
> Try this:
>
> <cffunction name="ones">
> <cfargument name="num" type="numeric">
> <cfset var result = "">
> <cfswitch expression="#num#">
> <cfcase value="1"><cfset result = "one"></cfcase>
> <cfcase value="2"><cfset result = "two"></cfcase>
> <cfcase value="3"><cfset result = "three"></cfcase>
> <cfcase value="4"><cfset result = "four"></cfcase>
> <cfcase value="5"><cfset result = "five"></cfcase>
> <cfcase value="6"><cfset result = "six"></cfcase>
> <cfcase value="7"><cfset result = "seven"></cfcase>
> <cfcase value="8"><cfset result = "eight"></cfcase>
> <cfcase value="9"><cfset result = "nine"></cfcase>
> </cfswitch>
> <cfreturn result>
> </cffunction>
>
> On Wed, Apr 2, 2008 at 11:21 AM, Keith
> <head_java@...> wrote:
>
> > Good Morning,
> >
> > I located a cfm program to convert numeric to
> words. 1 = one, 2 =
> > two etc. I'm trying to run this as a ajaxcfc
> component but when I do
> > a cfset results = #ones(thisNum)# (ones is a
> function within the
> > ajaxcfc component) javascript chokes on the
> returned value with
> > Object doesn't support this property or method. I
> think running the
> > function in the cfset is the cause. A shorten
> version of the
> > component is listed below:
> >
> > <cfcomponent extends="/AjaxCFC/ajax">
> >
> > <cffunction name="getLiteralDays">
> > <cfargument name="days" required="yes"
> type="numeric">
> > <cfset thisNum = #arguments.days#>
> > <cfset results = "">
> > <cfif len(thisNum) lt 2>
> > <cfset results = #ones(thisNum)#>
> > </cfif>
> > <cfreturn results />
> > </cffunction>
> >
> > <cffunction name="ones">
> > <cfargument name="num" type="numeric">
> > <cfswitch expression="#num#">
> > <cfcase value="1">one</cfcase>
> > <cfcase value="2">two</cfcase>
> > <cfcase value="3">three</cfcase>
> > <cfcase value="4">four</cfcase>
> > <cfcase value="5">five</cfcase>
> > <cfcase value="6">six</cfcase>
> > <cfcase value="7">seven</cfcase>
> > <cfcase value="8">eight</cfcase>
> > <cfcase value="9">nine</cfcase>
> > </cfswitch>
> > </cffunction>
> > </cfcomponent>
> >
> > Not sure how else to do this using ajaxcfc. Any
> suggestion would be
> > great. Thanks.
> >
> >
> >
>
________________________________________________________________________________\
____
You rock. That's why Blockbuster's offering you one month of Blockbuster Total
Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com