comp.lang.ada
 help / color / mirror / Atom feed
* Controlling width of strings during Put operation?
@ 2003-12-29  2:57 Peter C. Chapin
  2003-12-29  3:38 ` Robert I. Eachus
  0 siblings, 1 reply; 3+ messages in thread
From: Peter C. Chapin @ 2003-12-29  2:57 UTC (permalink / raw)



Hello!

I'm trying to print out a nice table of results using the standard IO 
packages. I can print the table rows fairly nicely. I see that the Put 
procedure in Integer_IO takes a Width parameter that is defaulted to 
Num'Width (Num being the type used to instantiate Integer_IO). That is 
fine. In fact, it's good.

My issue is: how do I best print the table headers? I could certainly 
play around with spaces until I got good looking results but that seems 
fragile and inelegant. I'd rather set a field width for each header 
based on the Num'Width of the numeric type in the column below that 
header. That way if I change the type of one of the columns, the headers 
have a prayer of still lining up without me fiddling with them again. My 
problem is that I don't see a Put procedure that allows me to specify a 
field width when I print a string. Do I have to "manually" prepare my 
own header strings with the appropriate number of padding spaces? Is 
there an easy way to do that?

Thanks!

Peter



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-29  4:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29  2:57 Controlling width of strings during Put operation? Peter C. Chapin
2003-12-29  3:38 ` Robert I. Eachus
2003-12-29  4:19   ` Peter C. Chapin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox