At 06:43 AM 6/8/2001 -0400, Chuck Esterbrook wrote:
>My designers want to generate some links like:
>         a | b | c
>
>Note the vertical bars between the elements. My first cut is something like:
>         #for $foo in $bars
>                 $bar |
>         #end for
>
>But this gives:
>         a | b | c |
>
>DTML solves this by offering a higher-level for (called <dtml-in>). The 
>loop has access to the value, index, etc. If TS has this, it would be 
>something like:
>         #for $foo in $bars
>                 $foo.value
>                 #if not $foo.isLast
>                         |
>                 #end if
>         #end for
>
>My questions:
>   - Can I accomplish "a | b | c" in TS now? If so, how?
>   - Should we expand TS's #for with the power of <dtml-in>? (I think so.)

In Python you could say:

separator = ''
for foo in bars:
         write(separator)
         write(foo)
         separator = ' | '

Translate that to TemplateServer syntax and you're all set.

- Geoff


_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to