Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/ab87d523b5c7ee657c3ba39e5225e5e7 to your computer and use it in GitHub Desktop.
Save trycf/ab87d523b5c7ee657c3ba39e5225e5e7 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
function switchTest(required numeric input){
switch(arguments.input){
case 1:
return "item 1";
case 2:
default:
return "item 2";
case 3:
return "item 3";
case 4:
return "item 4";
}
}
writeOutput("<div>1 = #switchTest(1)#</div>");
writeOutput("<div>2 = #switchTest(2)#</div>");
writeOutput("<div>3 = #switchTest(3)#</div>");
writeOutput("<div>4 = #switchTest(4)#</div>");
writeOutput("<div>-1 = #switchTest(-1)#</div>");
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment