From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Ada Recursion with strings
Date: Wed, 01 Oct 2008 11:48:34 +0200
Date: 2008-10-01T11:48:34+02:00 [thread overview]
Message-ID: <48e34772$0$17131$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <8e3685ad-8a71-4912-a86d-746076215606@64g2000hsu.googlegroups.com>
Adam Beneschan schrieb:
> The function
>
> Ada.Strings.Fixed.Trim (S, Ada.Strings.Both)
>
> will get rid of all leading and trailing spaces from S.
>
> I'd much prefer to have an 'Image attribute that didn't add that blank
> (it only adds it for nonnegative numbers).
Can I suggest a stronger emphasis on the Ada packages providing
value-to-string conversions. Isn't the 'Image attribute already
overused? (Worse, non-portable 'Img seems to be popular.)
Anyway, the 'Image attribute is not available for all types.
> I'm not sure why the
> decision was made (back in Ada 83) to add the blank; having a
> formatted number with either a blank or a minus sign in front can help
> get numbers lined up in a report, but 'Image returns a variable-length
> string anyway so I don't think it could be used effectively to line
> anything up.
Just speculating, maybe positioning used this procedure?
procedure SET_COL (TO : in POSITIVE_COUNT);
Anyway, there is, and seems to have been,
procedure PUT(TO : out STRING;
ITEM : in NUM;
BASE : in NUMBER_BASE := DEFAULT_BASE);
where TO'Length would have to be equal to
the number of digits in Word/2**8.
next prev parent reply other threads:[~2008-10-01 9:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-30 20:30 Ada Recursion with strings Joe
2008-09-30 22:24 ` Adam Beneschan
2008-09-30 22:24 ` Jeffrey R. Carter
2008-10-01 0:13 ` Joe
2008-10-01 0:27 ` Jeffrey R. Carter
2008-10-01 1:15 ` Robert A Duff
2008-10-01 11:34 ` Jeffrey R. Carter
2008-10-01 14:29 ` Adam Beneschan
2008-10-01 15:18 ` Jean-Pierre Rosen
2008-10-01 16:47 ` Georg Bauhaus
2008-10-02 7:24 ` Niklas Holsti
2008-10-02 8:18 ` Ludovic Brenta
2008-10-03 6:54 ` Maciej Sobczak
2008-10-03 7:38 ` Jean-Pierre Rosen
2008-10-03 9:06 ` Dmitry A. Kazakov
2008-10-01 0:28 ` Adam Beneschan
2008-10-01 9:48 ` Georg Bauhaus [this message]
2008-10-01 10:22 ` Dmitry A. Kazakov
2008-10-01 3:01 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox