Created
September 14, 2020 17:37
-
-
Save trycf/ab87d523b5c7ee657c3ba39e5225e5e7 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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