From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,74e13f9928bee620 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-03 19:37:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!chi1.webusenet.com!news.webusenet.com!cyclone1.gnilink.net!wn11feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: Subject: Re: Base 12 Integer IO X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: <3AG%9.88344$to3.202513@rwcrnsc51.ops.asp.att.net> NNTP-Posting-Host: 12.211.13.75 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1044329855 12.211.13.75 (Tue, 04 Feb 2003 03:37:35 GMT) NNTP-Posting-Date: Tue, 04 Feb 2003 03:37:35 GMT Organization: AT&T Broadband Date: Tue, 04 Feb 2003 03:37:35 GMT Xref: archiver1.google.com comp.lang.ada:33743 Date: 2003-02-04T03:37:35+00:00 List-Id: "Paolo Argenton" wrote in message news:mailman.12.1044286941.3911.comp.lang.ada@ada.eu.org... Hi all ! I would like to do base 12 Integer IO; while the following code fragment works for I in 0..1488 loop Put( I, Width => 3, Base => 12 ); It has 2 drawbacks (for me at least) 1) the output is with leading base number and # i.e. 12#A40# while I would like to have the raw A40, for instance. 2) width is not fixed, i.e. I would like to have in the output 005 for -say- number 5 instead of one digit only. How can I fix these things? Can I do Integer IO to a string, in order to reformat the string as I desire? Thanks everybody Paolo Here is a small example (that runs and produces the correct result): WITH Ada.Strings.Fixed; USE Ada.Strings.Fixed; WITH Ada.Strings.Maps; USE Ada.Strings.Maps; WITH Ada.Text_Io; USE Ada.Text_Io; WITH Ada.Integer_Text_Io; USE Ada.Integer_Text_Io; PROCEDURE GetNumString IS value : Integer := 42; buffer : String( 1 .. 32 ); BEGIN Put( buffer, value, 12 ); DECLARE lbSet : Character_Set := To_Set( '#' ); notLb : Character_Set := NOT lbSet; text : String := Tail( Trim( Trim( buffer, notLb, notLb ), lbSet, lbSet), 4, '0' ); BEGIN Put_Line( text ); END; END GetNumString; Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino