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,330113ca111da154 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-23 18:09:45 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Hex ouput References: <3F97F61A.13088097@raytheon.com> In-Reply-To: <3F97F61A.13088097@raytheon.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 24 Oct 2003 01:09:35 GMT NNTP-Posting-Host: 63.184.8.150 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1066957775 63.184.8.150 (Thu, 23 Oct 2003 18:09:35 PDT) jrcarter010@earthlink.net NNTP-Posting-Date: Thu, 23 Oct 2003 18:09:35 PDT Xref: archiver1.google.com comp.lang.ada:1565 Date: 2003-10-24T01:09:35+00:00 List-Id: Jerry Petrey wrote: > Also if you want to output hex numbers without the 16#xxxx# format, here is a > short routine to do that: [code deleted] Hi, Jerry. Every Mon I still see the same bunch of vapor jobs with Raytheon on the net. Your version is too limited for my tastes. Why limit yourself to base 16, and to blank-padded images? I've recently developed and am using this (lines may wrap): with Ada.Text_IO; package Images is subtype Field is Ada.Text_IO.Field; subtype Number_Base is Ada.Text_IO.Number_Base; generic -- Signed_Image type Number is range <>; function Signed_Image (Value : Number; Width : Field := 0; Zero_Filled : Boolean := False; Base : Number_Base := 10) return String; -- Returns an image of Value, at least Width characters wide, in base Base, padded with blanks or zeroes, -- according to Zero_Filled generic -- Modular_Image type Number is mod <>; function Modular_Image (Value : Number; Width : Field := 0; Zero_Filled : Boolean := False; Base : Number_Base := 10) return String; -- Returns an image of Value, at least Width characters wide, in base Base, padded with blanks or zeroes, -- according to Zero_Filled end Images; (Body available on request.) Perhaps I should add to the comments some indication that the images do not include the B#...# for bases other than 10. When I feel confident with it, it will probably be added to the PragmAda Reusable Components. -- Jeff Carter "C++ is like jamming a helicopter inside a Miata and expecting some sort of improvement." Drew Olbrich 51