Last active
August 29, 2015 14:07
-
-
Save CreativeNotice/be97c68396b3e80c84f0 to your computer and use it in GitHub Desktop.
An update to Nathan Dintenfass' function at http://www.cflib.org/udf/QueryToArrayOfStructures. I've removed pre CF9 support to save a couple lines.
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
private array function QueryToArrayOfStructures( required query theQuery ){ | |
var theArray = []; | |
var cols = ListtoArray(theQuery.columnlist); | |
for( var row=1; row <= theQuery.recordcount; row=row+1 ){ | |
var thisRow = {}; | |
for( var col=1; col <= arraylen(cols); col=col+1 ){ | |
thisRow[cols[col]] = theQuery[cols[col]][row]; | |
} | |
arrayAppend(theArray, thisRow); | |
} | |
return(theArray); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment