<CFSWITCH EXPRESSION="expression"> <CFCASE VALUE="value" DELIMITERS="delimiters"> HTML and CFML tags </CFCASE> additional <CFCASE></CFCASE> tags <CFDEFAULTCASE> HTML and CFML tags </CFDEFAULTCASE> </CFSWITCH>
Used with CFCASE and CFDEFAULTCASE, the CFSWITCH tag evaluates a passed expression and passes control to the CFCASE tag that matches the expression result. You can optionally code a CFDEFAULTCASE tag, which receives control if there is no matching CFCASE tag value.
Required. Any ColdFusion expression that yields a scalar value. ColdFusion converts integers, real numbers, Booleans, and dates to numeric values. For example, TRUE, 1, and 1.0 are all equal.
Required. One or more constant values that CFSWITCH compares to the specified expression (case-insensitive comparison). If a value matches the expression, CFSWITCH executes the code between the CFCASE start and end tags.
Separate multiple values with a comma or an alternative delimiter, as specified in the DELIMITERS parameter. Duplicate value attributes are not allowed and will cause a runtime error.
Optional. Specifies the character that separates multiple entries in a list of values. The default delimiter is the comma (,).