[stringtemplate-interest] Ok, I'm stumped
Barnes, Jeff
JB0284 at att.com
Mon Aug 6 11:52:23 PDT 2007
My distro is about a month old...
Terence
[Z at 1ffbd68 I'm True
Parr
I'm False
public static void main(String[] args)
{
Form f = new Form();
f.names = new String[] { "Terence", "Parr" };
f.values = new boolean[] { false, true };
StringTemplate st = new StringTemplate(
"$form.names,form.values:{ name, value |\n" +
"$name$\n" +
"$value$ " +
"$if(value)$I'm True$else$I'm False$endif$" +
"};separator=\"\n\"$");
st.setAttribute("form", f);
System.out.println(st.toString());
}
-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Terence
Parr
Sent: Monday, August 06, 2007 2:47 PM
To: StringTemplate
Subject: Re: [stringtemplate-interest] Ok, I'm stumped
On Aug 6, 2007, at 11:37 AM, Barnes, Jeff wrote:
> No it doesn't work either.
wow!
Hmm...maybe I fixed something. I get
/tmp $ java Test
Terence
false I'm False
Parr
true I'm True
public static void main(String[] args)
{
Form f = new Form();
f.names = new String[] { "Terence", "Parr" };
f.values = new boolean[] { false, true };
StringTemplate st = new StringTemplate(
"$form.names,form.values:{ name, value |\n" +
"$name$\n" +
"$value$ " +
"$if(value)$I'm True$else$I'm False$endif$" +
"};separator=\"\n\"$");
st.setAttribute("form", f);
System.out.println(st.toString());
}
which seems right given false followed by true.
Ter
_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list