Tests for a parameter's existence, tests its data type, and, if
a default value is not assigned, optionally provides one.
<cfparam name="">
cfparam(name="", default="", pattern="");
Anyanyarraybinarybooleancreditcarddatetimeemaileurodatefloatnumericguidintegerqueryrangeregexregular_expressionssnsocial_security_numberstringstructtelephoneurluuidusdatevariablenamexmlzipcode<bx:param> in BoxLang
A very basic CFML cfparam example
<cfparam name="userID" default="0"/>
Throws an error if the value is not one of a list of possible values
<cfparam name="sortdir" default="ASC" type="regex" pattern="ASC|DESC"/>
Three ways to use the param shorthand inside of a cfscript tag
param someVar; //declare the param
param someVar=5; //declare the param with a default value
param numeric someVar=3.1415; //declare the param with adefault value and set the type
Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.