Last active
December 21, 2015 10:29
-
-
Save adamcameron/6292430 to your computer and use it in GitHub Desktop.
Cross-platform version of Aurel's code
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> | |
void function test(string title, array values) { | |
writeOutput("<h3>#title#</h3>"); | |
for (var v in values) { | |
writeDump(var=v,expand=false); | |
try { | |
b = v ? true : false; | |
writeOutput ("#v# is true: #b#"); | |
} catch (any e) { | |
writeOutput ("#e.message# #e.detail#"); | |
} | |
writeOutput ("<br/>"); | |
} | |
writeOutput ("<hr size='1'/>"); | |
} | |
test("booleans",[false, true]); | |
test("numerics", [-2, -1, 0, 1, 2]); | |
test("strings", ["", "something", "1", "0"]); | |
test("arrays", [[], [1], [1, 2], ["something"]]); | |
test("structs", [{}, {a= 1}, {a= 1, b=2}, {a= "something"}]); | |
test("queries", [queryNew("")]); // test object | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment