[ic] loop-last question
Grant
listbox at email.com
Fri Oct 10 15:56:24 EDT 2003
> On Thursday 09 October 2003 16:35, Grant wrote:
> > [tmp counter]0[/tmp]
> > [loop search="ml=10000/ra=yes"]
> > [tmp counter][calc] [scratch counter] + 1 [/calc][/tmp]
> > code: [loop-code]<br />
> > [loop-last][calc] return 1 if '[scratch counter]' > 9;
> > [/calc][/loop-last]
> > [/loop]
> >
> > and it returns all of the SKUs in my products table. It seems like the
> > loop should stop when the counter hits 9. Does anyone know
> what I'm doing
> > wrong?
>
> Try:
>
> [loop search="ml=10000/ra=yes"]
> code: [loop-code]<br />
> [loop-last][calc] return '[loop-increment]' > 9;
> [/calc][/loop-last]
> [/loop]
>
> (Of course, you could also just set ml=9, but I assume you're
> just using a
> contrived example to show your point.)
Thanks Chris. I didn't know what loop-increment was. Time to get rid of my
counters. Thanks to your help I've got loop-last doing what I need. But
I'm wondering if there's a way to use it without calc. Here's an example
that works with calc:
[loop search="ml=10000/ra=yes"]
code: [loop-code]<br />
[loop-last][calc] return '[loop-code]' eq 'sku-20'; [/calc][/loop-last]
[/loop]
How could it be written without calc?
- Grant
More information about the interchange-users
mailing list