Whatever message this page gives is out now! Go check it out!
<cfcase
value = "value|delimited set of values"
delimiters = "delimiter characters">Attribute | Req/Opt | Default | Description |
value | Required | The value or values that the expression attribute of the cfswitch tag must match. To specify multiple matching values, separate the values with the delimiter character. The value or values must be simple constants or constant expressions, not variables. | |
delimiters | Optional | , (comma) | Specifies the delimiter character or characters that separate multiple values to match. If you specify multiple delimiter characters, you can use any of them to separate the values to be matched. |
<cfcase value="red,blue,green"><cfcase value="cargo, live;cargo, liquid-cargo, solid" delimiters=";-"><cfset language = "ColdFusion">
<cfswitch expression="#language#">
<cfcase value="ColdFusion">I like ColdFusion!</cfcase>
<cfcase value="Python;Julia" delimiters=";">I like Python!</cfcase>
<cfcase value="Java">I like Java!</cfcase>
<cfdefaultcase>Sorry, find your own language!</cfdefaultcase>
</cfswitch><cfscript>
language="ColdFusion"
switch(language){
case "ColdFusion":
writeOutput("I like ColdFusion")
break
case "Python": case "Julia":
writeOutput("I like Python")
break
case "Java":
writeOutput("I like Java")
break
default:
writeOutput("Sorry, bring your own language!")
break
}
</cfscript>