Let me change the topic for a minute and help prove whether or not I'm crazy.
I'm trying to send the current index of a "for loop" as a number to another function
in the cfc to build an array of objects. I keep getting this lame error. If I specify
"aNumber" type of any, it works but I think it is treating it as a string because I
can see the number in the resulting array. I won't all me to specify the type as a
number or use it in an additional function that requires a number. The var "i" is a
number.... right? wtf!
ERROR MESSAGE: The argument ANUMBER passed to function new() is not of type number.
If the component name is specified as a type of this argument, the reason for this
error might be that a definition file for such component cannot be found or is not
accessible.
<cffunction ...
...
for(i=1; i lte daysinthemonth; i=i+1){
arrayAppend(this.objArray,createObject('component','inetcfc.calendar.Date'));
this.objArray[i].new(aNumber=i);
}
....
</cffunction>
<cffunction name="new" access="public" returntype="any" output="No">
<cfargument name="aNumber" type="number" required="Yes">
...
<cfscript>
this.ShouldBeNumeric = arguments.aNumber; // if argument type of any this works
this.Date = createDate(2003,4,arguments.aNumber); // but this bombs
...
</cfscript>
</cffunction>
Justin Hansen
~~~~~~~~~~~~~~~~~~~~~~
Uhlig Communications
Systems Engineer
~~~~~~~~~~~~~~~~~~~~~~
[EMAIL PROTECTED]
913-754-4273 Office
816-695-4045 Mobile
~~~~~~~~~~~~~~~~~~~~~~
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).