21 Oct
2004
21 Oct
'04
5:26 p.m.
On Thu, 21 Oct 2004 04:47:01 -0400, Miro Jurisic
In article
, "Barak Simon" wrote: I have noticed that the format library does not support at present the printf asterisk for providing dynamic width as an extra parameter. Unfortunately my users need to use this widely and I would really hate to revert back to a non-typesafe solution.
A typesafe solution is to use "format ("%1%") % string(buf, len)" if I understand the question correctly.
That would only work for string types. The * width specifier can be used with ANY type, e.g.: printf ("|%*d|", 6, 42); Yields "| 42|". -- Caleb Epstein caleb.epstein@gmail.com