I would venture away from passing in 0 to mean null. Unless you're sure there's no way it should ever be 0. And even then maybe not.
If you're providing types to your arguments mainly for documentation purposes, consider putting that it should be a number in the argument's hint attribute if the name is not obvious enough. Sam On Tue, Jan 27, 2009 at 4:50 PM, Jared Rypka-Hauer <[email protected]>wrote: > > Yeah, you need to deal with the fact that "" is non-numeric.There's > actually a bunch of different ways to do this though... have your > cfargument with type="numeric" also have default="0", or pass in a 0 > for that argument, or have type="any" or type="string" and do > isNumeric(arguments.myNumber) before doing anything with it. Check for > structKeyExists(arguments,"myNumber) before doing anything in your > function. > > There's a bazillion ways to make sure the argument is correct... just > pick one and go with it. > > J > > On Jan 27, 2009, at 3:51 PM, Matt Quackenbush wrote: > > > If you pass an empty string to a type="numeric" argument, an > > exception will be thrown because you're not passing a numeric > > value. So, either don't pass an empty string and check for the > > existence of the argument inside the function, or pass a 0. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
