Yeah, I wouldnt mind seeing that myself. But, yes, I'm sure there a couple gotchas.. like I said, it could vary based on how the variable gets sent to the page, how its set, why its set, what its for, etc... but I've never had a record (or anything other than the first item in an array) that was referenced by 0 (which is false in the cfif) so anything you'd want to do when the ID is bad, would go in the cfelse.
..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -----Original Message----- From: Michael Dinowitz [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 15, 2006 1:29 PM To: CF-Talk Subject: Re: Try/Catch vs. direct error handling Ah, but what if you don't want to give the id a default but instead want to give a login page instead. CFPARAM without a default throws an error if the variable does not exist. You can catch that or know that you may have to handle it and do so. In CFMX 6 there was an option to view the pre-compiled java code that your CF template turned into. This was VERY interesting as it showed things like CFIF and IIF() compiled down to the exact same code. I wonder what CFPARAM would compile down to in comparison to some CFIFs and how efficient it is under the hood. Just for knowledge sake. :) > As for the example you used, I'd most likely try something like... > > <cfparam name="id" default="0" /> > <cfif isnumeric(val(id))> > ID was given, is numeric, and is not 0 > <cfelse> > Id was not given or wasn't numeric and therefore is 0 > </cfif> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232390 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=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

