[stringtemplate-interest] Padding for all

Dreyer Ulf (CR/APA3) Ulf.Dreyer at de.bosch.com
Thu Jun 1 06:47:57 PDT 2006


Hi all!

Is there a simple way in ST to pad
any outputvalue from within a template?
That is without defining a load of
wrapper classes (attribute renderers).

(sorry if that has already been discussed
 200 times - I've only done a rough scan
 of the news-archives)

I'd like to format something like this
("<--" mark the padding)

(* -------------------------------- *)
(* Some text                        *)    <--  
(* some longer text                 *)    <--
(* -------------------------------- *)
IF ( ( Var1         = TRUE  ) AND         <--   
     ( Var_____2    = TRUE  ) AND         <--   
     ( Var_3        = TRUE  ) AND         <--   
     ( Var___4      = FALSE ) )		<--
THEN
END_IF

Terence what is your view on this? :

For best separation I would have to compute
the padded strings beforehand.
But if I want to use the same data in different
places that would be an awful lot of dublication.

Although padding is a computation on the data
it does not (not really) depend on the data
but on the output and should be possible within 
templates.

Ulf


More information about the stringtemplate-interest mailing list