Your options for type checking come in only 2 flavors... a) One of the buil-in types, like string, struct, etc. b) a type of CFC
So, a few examples 1) You can easily check to make sure a value is a number, use type=numeric 2) You can check for anumber greather zero by using two steps. 3) Let's say you had a really special kind of number. It has to be bigger than zero on MOndays, but less than zero on Tuesdays. You could easily write a UDF to validate that, put it in your CFC, then do like what I described in my email. Use type=numeric, then check in your method. 4) You could also make a CFC, SpecialNumber. When you create it, you pass in the #. The CFC handles all the silly checking. SO, you know that if X is an instance of SpecialNumber, then it is good to go. If another CFC wants to use a method and require that type of value, then you would just use type="SpecialNumber" for your cfargument tag. =========================================================================== Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com) Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia) Email : [EMAIL PROTECTED] Blog : www.camdenfamily.com/morpheus/blog Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Bryan F. Hogan > Sent: Thursday, January 08, 2004 9:30 AM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] Custom argument types > > This is what I wanted to know if was avoidable. Like having a > custom cfargument type. Say there wasn't a struct argument > value on the type attribute of cfargument, I want to be able > to create a function that checks whether the value is a > struct or not. And have it error when it's not. Just like all > the other type attribute values do. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden > Sent: Thursday, January 08, 2004 10:26 AM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] Custom argument types > > > If you want to validate a number, use numeric. If you want > numbers only > 1 and higher, or some other logic, then you would want to use > type=numeric and then use additional checking. > > ie > > <cfarugment name="foo" type="numeric" required="true"> > > <cfif foo lte 0> > <cfthrow ....> > </cfif> > > > ---------------------------------------------------------- > 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]
