Yeah, that's what I've ended up doing.  That seems silly though, because then I have to add some code to handle a default value that I don't want.

If CF is typeless, and the argument isn't required, then IMHO it shouldn't throw an error if you pass it an empty var - especially since (I believe) you can't set a variable explicitly to NULL.

Thanks,

Evan

>You'll have to try something liske this:
>
><cfargument name="promoItem" type="numeric" required="no" default="-1">
>
>---
>Exciteworks -- expert hosting for less!
>http://exciteworks.com
>specializing in reseller accounts
>
>
>Evan Lavidor wrote:
>
>> I've got a function inside of a CFC.  One of the arguments is defined
>> as follows:
>> <cfargument name="promoItem" type="numeric" required="no">
>>
>> If the value that I pass to it is empty ("") then I get an error that
>> "The argument PROMOITEM passed to function processInfo() is not of
>> type numeric."
>>
>> If I change the type to string, then it works great.  But I don't want
>> it to be a string.  The same behavior happens with a date (passing
>> blank string to an argument of type="date").
>>
>> Any ideas?  This is really strange behavior to me.  As CF is typeless,
>> shouldn't it be converting the empty string to a null number - or
>> something like that?
>>
>> Thanks,
>>
>> Evan
>>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to