I l @ ve RuBoard |
< CFSWITCH >/<CFCASE>/<CFDEFAULTCASE>Evaluates a passed expression and determines what <cfcase> matches that expression. The code within the matching <cfcase> tag is then executed. If there is no match, the code within the <cfdefaultcase> tag is executed. Syntax<cfswitch expression="expression"> <cfcase value="value_to_match_expression" delimiters="delimiter_of_list"> Code to be executed </cfcase> <cfdefaultcase> Code to be executed </cfdefaultcase> </cfswitch> AttributesExpression: Required. The values to be used to test against case values could be numbers , strings, or Boolean values. Value: Required. The value that is compared to the expression. You can separate multiple values with commas or with another value specified in the delimiter attribute. Delimiter: Optional. The character used to separate multiple values in the value attribute. Example<!--- Output a different message based on a URL variable status ---> <cfswitch expression="#url.status#"> <cfcase value="notready"> You are not ready! </cfcase> <cfcase value="ready"> You are ready! </cfcase> <cfdefaultcase> Your status is not known. </cfdefaultcase> </cfswitch> |
I l @ ve RuBoard |