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 08:02:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail From: Mark Biggar User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Base 12 Integer IO References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4ow%9.151629$VU6.71471@rwcrnsc52.ops.asp.att.net> NNTP-Posting-Host: 12.235.88.213 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52.ops.asp.att.net 1044288128 12.235.88.213 (Mon, 03 Feb 2003 16:02:08 GMT) NNTP-Posting-Date: Mon, 03 Feb 2003 16:02:08 GMT Organization: AT&T Broadband Date: Mon, 03 Feb 2003 16:02:08 GMT Xref: archiver1.google.com comp.lang.ada:33726 Date: 2003-02-03T16:02:08+00:00 List-Id: Paolo Argenton wrote: > 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? Yes, this allows you to do the usual trick to get leading zero's. tmp: string(1..8); for I in 0..12#bbb# loop put(tmp, 12#1000# + I, base => 12); put(tmp(5..7)); end loop; -- Mark Biggar mark.a.biggar@attbi.com