Controlling width of strings during Put operation?
From: Peter C. Chapin (pchapin_at_sover.net)
Date: 12/29/03
- Next message: Peter C. Chapin: "Re: Newbie question: How does one do bit manipulation in Ada?"
- Previous message: Robert I. Eachus: "Re: Certified C compilers for safety-critical embedded systems"
- Next in thread: Robert I. Eachus: "Re: Controlling width of strings during Put operation?"
- Reply: Robert I. Eachus: "Re: Controlling width of strings during Put operation?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Dec 2003 02:57:40 GMT
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
- Next message: Peter C. Chapin: "Re: Newbie question: How does one do bit manipulation in Ada?"
- Previous message: Robert I. Eachus: "Re: Certified C compilers for safety-critical embedded systems"
- Next in thread: Robert I. Eachus: "Re: Controlling width of strings during Put operation?"
- Reply: Robert I. Eachus: "Re: Controlling width of strings during Put operation?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|