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 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315675
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to