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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 13:05:04 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!In.nntp.be!news.codefab.com!att541!att542!ip.att.net!newsfeed3.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: "Xenos" Newsgroups: comp.lang.ada Subject: Re: Hex ouput Date: Thu, 23 Oct 2003 15:51:04 -0400 Organization: Lockheed Martin Corporation Message-ID: References: <3F97F61A.13088097@raytheon.com> NNTP-Posting-Host: 158.187.68.119 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Xref: archiver1.google.com comp.lang.ada:1538 Date: 2003-10-23T15:51:04-04:00 List-Id: "Jerry Petrey @raytheon.com>" <"jdpetrey wrote in message news:3F97F61A.13088097@raytheon.com... > You can find the Ada LRM at Amazon, among other places: > http://www.amazon.com/exec/obidos/tg/detail/-/3540430385/qid=1066923022/sr=1 -1/ref=sr_1_1/102-5165323-3419326?v=glance&s=books > > Also if you want to output hex numbers without the 16#xxxx# format, here is a > short routine to do that: > > > procedure Hex_Print (Num : in Integer; > Num_Of_Digits : in Positive) is > > Temp_Str : String (1 .. Num_Of_Digits + 5) := (others => '0'); > New_Str : String (1 .. Num_Of_Digits) := (others => '0'); > First_Digit : Positive; > > begin > > Put (To => Temp_Str, Item => Num, Base => 16); > > for I in 1 .. Num_Of_Digits + 4 loop > if Temp_Str (I) = '#' then > First_Digit := I + 1; > exit; > end if; > end loop; > > New_Str (First_Digit - 4 .. Num_Of_Digits) := > Temp_Str (First_Digit .. Num_Of_Digits + 4); > Put (New_Str); > > end Hex_Print; > > It could be improved some but should help you get the idea. > > Jerry > -- > -------------------------------------------------------------------------- ------- > > -- Jerry Petrey > -- Senior Principal Systems Engineer - Navigation (GPS/INS), Guidance, & > Control > -- Raytheon Missile Systems - Member Team Ada & Team Forth > -- NOTE: please remove in email address to reply > -------------------------------------------------------------------------- ------- > > > Thanks for the link! Incidentally, You can strip the 16# and the trailing # just by taking a slice. Assuming no leading or trailing spaced (Trim works nicely), I just used: S(4 .. S'Length - 1) Thanks, DrX.