[stringtemplate-interest] Output string lengths..

John Snyders jjsnyders at rcn.com
Wed Nov 29 07:37:53 PST 2006


I think that this is another case for the option syntax. For example:

$name;pad=20$

This would make sure that the value of name was padded with enough space
characters so that it was at least 20 characters.

The reason I think that option syntax is preferred over a custom renderer is
that this is another case where the template needs to be in control over the
format.

The render is fine for making sure the rules of HTML or SQL are followed and
also good at localization but when the template needs to decide on the
format the option syntax is the way to go.

-John

-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org]On Behalf Of Terence
Parr
Sent: Tuesday, November 28, 2006 8:33 PM
To: StringTemplate
Subject: Re: [stringtemplate-interest] Output string lengths..



On Nov 21, 2006, at 11:27 PM, Hill, Robert wrote:

> Is there anyway I can make each string in a list be rendered at a
> minimum length?
I cannot think of anything off the top of my head, other than some
kind of renderer that automatically pads the toString() output of its
wrapped object if the output is less than a particular length.

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