Created
February 16, 2016 00:56
-
-
Save anonymous/45481a49c17e95872523 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 valueArray (required query q, required string column) { | |
var output = []; | |
output.addAll(q[column]); | |
return output; | |
} | |
q = queryNew("column_a,column_b", "Integer,Varchar",[{column_a: 1, column_b: "Foo, Bar"}, {column_a: 2, column_b: "Bar, Baz"}]); | |
writedump(q); | |
writedump(valueArray(q, "column_a")); | |
writedump(valueArray(q, "column_b")); //respects commas | |
writedump(valueList(q.column_b)); | |
writedump(listToArray(valueList(q.column_b))); //problems! | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment