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:232363
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

Reply via email to