CFLOOP also provides iteration over a recordset with dynamic starting and stopping points. Thus you can begin at the tenth row in a query and end at the twentieth. This mechanism provides a simple means to get the next n sets of records from a query. The following example loops from the tenth through the twentieth record returned by "MyQuery":
<CFSET Start=10>
<CFSET End=20>
<CFLOOP QUERY="MyQuery"
STARTROW="#Start#"
ENDROW="#End#">
<CFOUTPUT>#MyQuery.MyColName#</CFOUTPUT><BR>
</CFLOOP>
The loop is done when there are no more records or when the current record is greater than the value of the ENDROW attribute.
|