comp.lang.ada
 help / color / mirror / Atom feed
From: Peter C. Chapin <pchapin@sover.net>
Subject: Controlling width of strings during Put operation?
Date: Mon, 29 Dec 2003 02:57:40 GMT
Date: 2003-12-29T02:57:40+00:00	[thread overview]
Message-ID: <MPG.1a5961997d61e67a989688@news.sover.net> (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



             reply	other threads:[~2003-12-29  2:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-29  2:57 Peter C. Chapin [this message]
2003-12-29  3:38 ` Controlling width of strings during Put operation? Robert I. Eachus
2003-12-29  4:19   ` Peter C. Chapin
replies disabled

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