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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,22b2c05a8088bbb2 X-Google-Attributes: gid103376,public From: Ken Garlington Subject: Re: Leading zeros with Int_IO.Put()? Or another package? Date: 1996/11/22 Message-ID: <3295EEB2.4F08@lmtas.lmco.com>#1/1 X-Deja-AN: 198174679 references: <327FB8A3.745B@itg-sepg.logicon.com> <55ubsh$lh0$1@goanna.cs.rmit.edu.au> <56bg5v$14u$1@goanna.cs.rmit.edu.au> <328A0A7D.21A2@lmtas.lmco.com> <56rfv3$q2b$1@goanna.cs.rmit.edu.au> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.02 (Macintosh; I; 68K) Date: 1996-11-22T00:00:00+00:00 List-Id: robin wrote: > > Really! The task is to convert to string type. You're saying > that that's not a type conversion. I thought the request was to generate formatted output via Int_IO.Put. I don't usually consider that a type _conversion_, but I suppose you could call it that. In any case, starting with an integer type, there would be an _additional_ type conversion (if you prefer) if you wanted to use the picture mechanism: integer -> decimal -> string vs. integer -> string The extra conversion isn't necessarily a bad thing; it's just that there's some housekeeping involved (making sure the range of the decimal type is compatible with the integer type) that you might not want to fuss with. Of course, if you want to go to a string, there may be other housekeeping (determining the string length) that's involved. Getting back to the topic, there's several good ways (and some poor ways) of using Ada to get the desired effect. Good software practices indicate that the specific mechanism chosen should be properly hidden behind an appropriate abstraction, so that the mechanism can be changed as needed. (The preceding paragraph appears to read equally well if "PL/I" is substituted for "Ada".) -- LMTAS - "Our Brand Means Quality" For more info, see http://www.lmtas.com or http://www.lmco.com