It seems, that the scipting version “switch / case” does not work with the comma as standard delimiter?!
Can anyone pleas test this code snippet?
<cfset variables.exp = "demo">
<cfswitch expression="#variables.exp#">
<cfcase value="test,demo">
Tag based output -> test,demo
</cfcase>
<cfdefaultcase>
Tag based output -> Default value
</cfdefaultcase>
</cfswitch>
<br>
<br>
<cfscript>
exp = "demo";
switch("#exp#"){
case "test,demo":
writeOutput("Script based output -> test,demo");
break;
default:
writeOutput("Script based output -> Default value");
}
</cfscript>
My enviroment:
OS: Debian 9.13 - Linux
Java Version: openJDK-11.0.11
Tomcat Version: 9.0.48
Lucee Version: Lucee 5.3.8.201