So yesterday I was working in cfscript and needed to loop over a query. I
reviewed my options and decided for elegance sake that a for / in loop was
choice. Only problem is that for / in loops in cfscript can't be used with
query objects. After trying a few things, I fell back and punted with the
following code:
qGetTheme = siteGW.GetSiteThemeValuesByThemeID(ARGUMENTS.themeID);
colList = qGetTheme.columnlist;
for ( item=1;item <= ListLen(colList);item++ ) {
SiteInfo.theme[ListGetAt(colList,item)] =
qGetTheme[ListGetAt(colList,item)][1];
}
I know this works, and is perfectly legit, but I'd love to see if there's a
better way of doing this in cfscript. Anyone?
Andy