[ic] loop-last confusion

Ed LaFrance edl at newmediaems.com
Thu Nov 6 13:05:51 EST 2003


At 12:23 PM 11/6/2003 -0800, you wrote:
>Could someone please explain to me why this stops after 9 iterations (as it
>should):
>
>[loop search="ml=100000/ra=yes"]
>         [loop-code]
>         [loop-last][if type="explicit" compare="[loop-increment] ==
>9"]1[/if][/loop-last]
>[/loop]
>
>and this does not:
>
>[tmp listing_counter]0[/tmp]
>[loop search="ml=100000/ra=yes"]
>         [tmp listing_counter][calc] [scratch listing_counter] + 1 
> [/calc][/tmp]
>         [loop-code]
>         [loop-last][if type="explicit" compare="[scratch listing_counter] ==
>9"]1[/if][/loop-last]
>[/loop]
>
>- Grant

... because all the [loop-*] stuff is parsed *before* the free-standing 
[tmp][/tmp] assignment. In your first example, the [if..] is enclosed in 
[loop-last], forcing it to be interpolated at the desired time. Please 
correct me anyone if I am wrong. There used to be a document which 
explained interpolation order in Interchange, and perhaps there still is, 
but I can't put my finger on it. I know that catalog and server variables 
get parsed before looping tags, which in turn get parsed before non-looping 
tags.

- Ed L.


>sers

===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          edl at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list