cf-talk  

Re: Repeating Data - Unsure of my use of cfquery

Ian Skinner
Tue, 16 Mar 2010 09:09:10 -0700

On 3/16/2010 8:22 AM, Steven Sprouse wrote:
> If so, what is the currentRow value? Just a little confused there.

currentRow is one of the values provided by ColdFusion about its query 
objects, just like columnList and recordCount.  It is simple the current 
row of the record set that is being processed in the current iteration 
of a query loop, either <cfoutput query...> or <cfloop query...> loops.  
You can use it any time you want to know what iteration you are on.

I.E a way to alternate row colors:
<cfiif aQuery.currentRow MOD 2>#darkBackground#</cfif>

You can normally ignore the need to keep track of the current row when 
you are looping over a single record set inside of a loop.  But once you 
nest two or more separate query loops inside each other, ColdFusion can 
no longer know for certain which iteration of which record set do you 
want to out put at a given point.  It falls on you to explicitly tell 
ColdFusion which iteration to use.  I.E. the aQuery.currentRow.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331791
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm