<!--- Control Whitespace Output --->
<CFSETTING ENABLECFOUTPUTONLY="Yes">

<!--- Simple Page counter, starting at first "Page" --->
<CFSET ThisPage = 1>

<!--- Loop thru row numbers, in increments of RowsPerPage --->
<CFLOOP FROM="1" TO="#TotalRows#" STEP="#RowsPerPage#" INDEX="PageRow">
  <!--- Detect whether this "Page" currently being viewed --->
  <CFSET IsCurrentPage = (PageRow GTE URL.StartRow) AND (PageRow LTE EndRow)>
  
  <!--- If this "Page" is current page, show without link --->
  <CFIF IsCurrentPage>
    <CFOUTPUT><B>#ThisPage#</B> </CFOUTPUT>  
  <!--- Otherwise, show with link so user can go to page  --->  
  <CFELSE>
    <CFSET LinkURL = "#CGI.SCRIPT_NAME#?StartRow=#PageRow#">
    <CFOUTPUT><A HREF="#LinkURL#">#ThisPage#</A> </CFOUTPUT>
  </CFIF>

  <!--- Increment ThisPage variable --->
  <CFSET ThisPage = ThisPage + 1>
</CFLOOP>

<!--- Control Whitespace Output --->
<CFSETTING ENABLECFOUTPUTONLY="No">