Re: [Templates] paginator - newbie question
[prev]
[thread]
[next]
[Date index for 2004/05/24]
On Sat, May 22, 2004 at 02:12:16PM -0400, leegold wrote:
> Dave et. al,
> Previous post example has been a great help, forced me to learn my
> data structures esp. hash arrays. I have question about output.
>
> Last page should have the 7th rec. but 7th rec.is not showing.
> What is cause? Shouldn't splice pick-up last record?
> Don't know if you can see it but there's garbage
> chars on the 1st line of output after every tpage(?)
> I'm using a dos cmd line in Win2K.
> See below. Again, Thanks.
Yep. I see that problem too. Seems to occur whenever a page contains
only one entry. Set the number of items on a page to 1 and you'll
never get any useful output.
I suggest contacting the authors of Template::Plugin::Page and
Data::Page to ee if they can shed any light.
Dave...
> .dat
> -----
> id : name : description
> 1 : one : number one
> 2 : two : the second number
> 3 : three : a third number
> 4 : four : number, the fourth
> 5 : five : numero cinco
> 6 : six : six (not sex)
> 7 : seven : lucky for some
>
> .tt
> -------
> [% USE numbers = datafile('numbers.dat') -%] [% USE page =
> Page(numbers.size, 3, currpage) -%] Page [% page.current_page %] of [%
> page.last_page %] Entries [% page.first %] to [% page.last %] of [%
> page.total_entries %]
>
> [% FOREACH num = page.splice(numbers) -%] [% num.id %] [% num.name |
> format('%-
> 8s') %] [% num.description %] [% END -%]
>
> [% FOREACH num = numbers -%] [% num.id %] [% num.name | format('%-8s')
> %] [% num.description %] [% END -%]
>
> output
> -------
> A:\>tpage --define currpage=3 page.tt
> Page 3 of 3
> Entries 7 to 7 of 7
>
>
>
>
>
> one number one
> two the second number
> three a third number
> four number, the fourth
> five numero cinco
> six six (not sex)
> seven lucky for some
>
> A:\>tpage --define currpage=1 page.tt
> Page 1 of 3
> Entries 1 to 3 of 7
>
> one number one
> two the second number
> three a third number
>
> one number one
> two the second number
> three a third number
> four number, the fourth
> five numero cinco
> six six (not sex)
> seven lucky for some
>
> A:\>
>
> --
> http://www.fastmail.fm - A no graphics, no pop-ups email service
--
We are far too young and clever
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates