[ic] loop-last based on a scratch value

Grant listbox at email.com
Fri Nov 7 10:42:03 EST 2003


> Grant wrote:
>
> >The following doesn't work.  Is it a syntax problem, or is a
> loop-last based
> >on a scratch value just not going to happen?
> >
> >[loop-last][loop-calc] return 1 if $Scratch->{listing_counter} == 4;
> >[/loop-calc][/loop-last]
> >
> >
> >
> It doesn't work because you're doing nothing to increment your
> counter...  Besides, this code fragment doesn't clearly show what you
> are really trying to do...
>
> Barry

You're right.  Here's the code I'm using to test it:

[loop list="1 2 3 4 5 6 7 8 9"]
[tmp listing_counter][calc] [scratch listing_counter] + 1 [/calc][/tmp]
[loop-last][calc] return 1 if $Scratch->{listing_counter} == 4;
[/calc][/loop-last]
[loop-code] - [scratch listing_counter]
[/loop]

- Grant



More information about the interchange-users mailing list