0 Replies Latest reply on Jul 28, 2006 9:50 AM by jimmylharrell

    Help Counting Records in an Array

    jimmylharrell
      I had a friend help me build this but now he's gone and I don't understand arrays or coldfusion really. I have an image gallery that works beautifully except that I want to be able to add two behaviors to the page. 1.Pagination. 2. Display Record Count. (I know how to use the Dreamweaver built in Server Behaviors with Dynamic Tables but this is a little different from that b/c he's using arrays to build the table instead. I've almost go the pagination working. Except I can't figure how to show the last record. I've got "First, Next, & Previous" to work. But the "Last" doesn't. This is the part of the code that I'm concerned with as everything else is working.

      <cfset CountUp=Count + 10>
      <cfset CountDown=Count - 10>
      <p align="center"><cfif Count gte 10><a href="gallery.cfm?Count=<cfoutput>#CountDown#</cfoutput>">Previous</a></cfif>  <cfif ArrayLen(PhotoArray) gt CountUp><a href="gallery.cfm?Count=<cfoutput>#CountUp#</cfoutput>">Next</a></cfif>  <cfif ArrayLen(PhotoArray) lt CountUp><a href="gallery.cfm?Count=<cfoutput>#CountUp##CountDown#</cfoutput>">Last</a></cfif>