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-Thread: 103376,f3514db0a21f9b44 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!postnews.google.com!x12g2000yqx.googlegroups.com!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Hexadecimal and stream element arrays Date: Mon, 19 Apr 2010 12:17:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <90efa5d2-a438-451b-8eb6-0e913b4200ca@x12g2000yqx.googlegroups.com> References: <2f4313a5-bb3d-4f7f-8a86-7c8f7d549c53@k41g2000yqf.googlegroups.com> NNTP-Posting-Host: 75.244.206.245 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1271704637 29330 127.0.0.1 (19 Apr 2010 19:17:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 19 Apr 2010 19:17:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x12g2000yqx.googlegroups.com; posting-host=75.244.206.245; posting-account=yOOUcAoAAABjcyl4BUJf9FM0ne56zA9Q User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100401 Ubuntu/9.10 (karmic) Firefox/3.5.9,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:10072 Date: 2010-04-19T12:17:17-07:00 List-Id: On Apr 19, 9:24=A0am, Ludovic Brenta wrote: > > If you want to avoid the 16## part, you can easily convert the > stream_elements to a string representation yourself like so: > > function To_Hex (E : in Ada.Streams.Stream_Element) return String is This seems unnecessarily complex to me. Using the standard library to put an element to a String in base 16, then stripping the "16#" from the front and '#' from the end seems simpler, clearer, and less error prone. The PragmAda Reusable Components include Image functions with optional Width, Zero_Filled, and Base parameters that do not include any base indicator in the image. See PragmARC.Images and PragmARC.Images.Image. http://pragmada.x10hosting.com/