[stringtemplate-interest] Working with filtered list
Grzegorz Danowski
gdn at poczta.onet.pl
Tue Jun 26 08:29:35 PDT 2007
Well, I have moved filtering to c# code and problem have been solved :-).
But I wonder if there is simple way to do it in ST.
Regards,
Gregory
_____
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Grzegorz
Danowski
Sent: Monday, June 25, 2007 3:41 PM
To: stringtemplate-interest at antlr.org
Subject: [stringtemplate-interest] Working with filtered list
Hi,
I would like to filter list of customers and simultanously if output list
contains more customers then one I'd like to add sequence number.
I have found template that filter data:
StringTemplate template = new StringTemplate("$data:{" +
"$if(it.IsSmart)$$it.CustomerName$$endif$}$");
And have found template that add sequence number if customers number is
greater then one:
StringTemplate template = new StringTemplate(
"$if(rest(data))$$data:{$i$. $it.CustomerName$}$" +
"$else$$data.CustomerName$$endif$");
But I don't know how connect both functionalities in one tempate.
Regards,
Gregory
__________ NOD32 2351 (20070625) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070626/753c00c7/attachment.html
More information about the stringtemplate-interest
mailing list