Someone wrote a really nice customtag and posted it up here a while back,
recordsetbrowser.cfm, it did all of this in itself...
If you don't find it in the archives, shout me off list and I'll get a copy
over to you..
-----Original Message-----
From: Stuart Kidd [mailto:[EMAIL PROTECTED]
Sent: 11 March 2004 12:04
To: CF-Talk
Subject: RE: Loops in Loops (let's go loopy)
Thanks Tim and Pascal,
That's the trick... before the replies came i was kind of getting the hang
of it but my maths was all wrong i had (i/10)-1 but i can see it now.
---------- Original Message ----------------------------------
From: "Tim Blair" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Thu, 11 Mar 2004 11:49:02 -0000
>> is there an easier way?
>
>I usually do that by having a couple of variables:
>
>page -> the current page you're on (from URL)
>pagesize -> the number of items on a page (hardcode/from URL)
>recordcount -> the total number of results (from your query)
>
>You can then work out things like the total number of pages (the ceiling
>function is to round the number of pages up to the closest integer) :
>
><cfset pagecount = ceiling(recordcount / pagesize)>
>
>And then loop from 1 to pagecount and print out a number and link each
>time:
>
><cfloop from="1" to="#pagecount#" index="curpage">
> <a href="">
></cfloop>
>
>HTH,
>
>Tim.
>
>
>-------------------------------------------------------
><CF_CodingContest mode="judging" newentries="false">
>Maze Solver - http://tech.badpen.com/cfcontest/
>-------------------------------------------------------
>RAWNET LTD - Internet, New Media and ebusiness Gurus.
>WE'VE MOVED - for our new address, please visit our
>website at http://www.rawnet.com/ or call us any time
>on 0800 294 24 24.
>-------------------------------------------------------
>This message may contain information which is legally
>privileged and/or confidential. If you are not the
>intended recipient, you are hereby notified that any
>unauthorised disclosure, copying, distribution or use
>of this information is strictly prohibited. Such
>notification notwithstanding, any comments, opinions,
>information or conclusions expressed in this message
>are those of the originator, not of rawnet limited,
>unless otherwise explicitly and independently indicated
>by an authorised representative of rawnet limited.
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Loops in Loops (let's go loopy) Stuart Kidd
- RE: Loops in Loops (let's go loopy) Pascal Peters
- RE: Loops in Loops (let's go loopy) Tim Blair
- Re: Loops in Loops (let's go loopy) Stuart Kidd
- RE: Loops in Loops (let's go loopy) Tim Blair
- RE: Loops in Loops (let's go loopy) Stuart Kidd
- RE: Loops in Loops (let's go loopy) Tim Blair
- Re: Loops in Loops (let's go loopy) John Beynon
- Re: Loops in Loops (let's go loopy) Cedric Villat