Stuart Johnston wrote:
> Since my problem requires adding the suffix regardless of length, 
[...]
> I'm not sure what example you are referring to but my problem is that I 
> need the complete, final string to be less than a certain length so I 
> can't simply use "_".

Is it not as simple as truncating the string to 18 characters and then 
adding the suffix?

   [% string.truncate(18).append('_colname_seq') %]

You could turn it into a MACRO if you prefer:

 [%  USE String;

     MACRO truncadd(text, suffix) BLOCK;
        length = 30 - suffix.length;
        String.new(text).truncate(length).append(suffix);
     END;
 %]

 [% truncadd('verylongtablenameindeed', '_column_seq') %]

=> verylongtablenamein_column_seq

HTH
A



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to