comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: How to get this space away?
Date: Tue, 02 Jun 2015 15:28:31 -0700
Date: 2015-06-02T15:28:31-07:00	[thread overview]
Message-ID: <mklak6$pqe$1@dont-email.me> (raw)
In-Reply-To: <bb2c2d5e-bd38-4598-ace9-1607a5bbf2cd@googlegroups.com>

On 06/02/2015 01:32 PM, Laurent wrote:
> 
> rtAST-N237|rr 12345678|t1 1|o1strpne|ra|a1am|a3<=2|a4+| 
>                      ^-------------^
> The function which generates this string:
> 
>    --------------
>    -- To_BCI --
>    --------------
>    function To_BCI (Item : Carte) return V_String.Bounded_String is
>       V_Antibiotiques : V_String.Bounded_String;
>       V_Carte         : V_String.Bounded_String;
>       V_Germe         : V_String.Bounded_String;
>       use V_String;
>    begin
> 
> -- generates the |rr 12345678 par; Lot is a Positive
>       V_Carte := ((+"|ta|rt") & (+Item.Code_SIL) & (+"|rr") & (+Item.Lot'Img)); 

'Img is GNAT-specific attribute that is equivalent for T'Image (Object), where T
is the type of Object. Since you say Lot is a Positive, that means Item.Lot'Img
is equivalent to Integer'Image (Item.Lot). 'Image always adds a leading space
for a non-negative value. Nobody seems to like it, but the ARG won't change it.

You can get rid of the space yourself, or you could use something like
PragmARC.Images that gives you control over width, base, and zero filling.

The PragmAda Reusable Components are available from

https://pragmada.x10hosting.com/pragmarc.htm

-- 
Jeff Carter
"Frankie Wolf, wanted by Federal authorities for
dancing with a mailman."
Take the Money and Run
143


  parent reply	other threads:[~2015-06-02 22:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 20:32 How to get this space away? Laurent
2015-06-02 20:53 ` Simon Wright
2015-06-03 18:59   ` Laurent
2015-06-03 19:30     ` Simon Wright
2015-06-02 22:28 ` Jeffrey R. Carter [this message]
2015-06-03 19:07   ` Laurent
2015-06-03 20:50     ` J-P. Rosen
2015-06-03 23:00       ` Randy Brukardt
2015-06-05  9:26         ` Stephen Davies
2015-06-08 12:33         ` Brad Moore
2015-06-08 19:47           ` Randy Brukardt
2015-06-08 20:25             ` Jeffrey R. Carter
2015-06-09 14:38               ` Brad Moore
2015-06-04  9:37       ` Georg Bauhaus
2015-06-04 12:32         ` Dmitry A. Kazakov
2015-06-05 13:02       ` Laurent
2015-06-06  0:02         ` Dennis Lee Bieber
2015-06-03  7:28 ` Dmitry A. Kazakov
2015-06-03 19:19   ` Laurent
2015-06-08 22:43 ` wowwomenonwheels205
replies disabled

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