Ahhhhh, someone mentioned a custom tag years ago, was it you?
Mike, are you saying...
<cfparam name="myVar">
.... will throw an error when myVar doesn't exist?
If so, that's even better, cfparam could do all that we're asking of it:
<cfset myID = "not an ID, not a number, a string!">
<cfparam name="myID" type="numeric" default="0">
<!--- By here myID would be 0 and no error thrown --->
and
<cfparam name="myID" default="0">
<!--- Set myID to 0 if it doesn't exist --->
and
<cfset myID = "not an ID, not a number, a string!">
<cfparam name="myID" type="numeric">
<!--- Throw an error if myID doesn't exist or if it exists and isn't
numeric --->
and
<cfparam name="myID">
<!--- Throw an error if myID doesn't exist --->
Doesn't that cover all bases? You can get an error to be throw based on type
and existence AND you can get defaults based on type and existence.
I think! :OD
Adrian
-----Original Message-----
From: Cedric Villat [mailto:[EMAIL PROTECTED]
Sent: 14 February 2006 21:42
To: CF-Talk
Subject: Re: [OT] Future CF Features
Adrian,
I made a custom tag called cf_param that does exactly this. If the type of
the variable does not match, such as your case, the default value is used.
You can get the custom tag at http://www.cornfeed.com. It is a couple years
old, but works just fine, as I use it all over the place.
Cedric
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232282
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54