Last active
December 21, 2015 05:38
-
-
Save adamcameron/6257903 to your computer and use it in GitHub Desktop.
Demonstrates incompat between CF and Railo in how Railo handles to TOP attribute for arrays and queries.
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> | |
q = queryNew(""); | |
queryAddColumn(q, "id", "integer", [1,2,3,4,5,6]); | |
a = makeArray(6); | |
st = makeStruct(6); | |
writeDump(var=q, top="3"); | |
writeDump(var=a, top="3"); | |
writeDump(var=st, top="3"); | |
struct function makeStruct(x){ | |
if (x<=1) return {"#x#"=x-1}; | |
var st = {}; | |
for (var i=1; i <= x; i++){ | |
st[i] = makeStruct(x-1); | |
} | |
return st; | |
} | |
array function makeArray(x){ | |
if (x<=1) return [x-1]; | |
var a = []; | |
for (var i=1; i <= x; i++){ | |
a[i] = makeArray(x-1); | |
} | |
return a; | |
} | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment