From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 13 Apr 92 17:31:49 GMT From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!agate !dog.ee.lbl.gov!hellgate.utah.edu!cs.utah.edu!kmsimons@ucbvax.Berkeley.EDU (Ke vin Simonson) Subject: integer'image versus integer_io Message-ID: <1992Apr13.113149.20126@hellgate.utah.edu> List-Id: If I want to output an integer to standard output, or to a file, I can do it either by instantiating the generic package "integer_io", or by using the "integer'image" attribute. Therefore the following code gives me iden- tical results: package IIO is new text_io.integer_io (integer); II : integer; text_io.put ("Enter value: "); IIO.get (II); text_io.put ("Value entered is ["); IIO.put (II, 1); text_io.put_line ("]."); versus package IIO is new text_io.integer_io (integer); II : integer; text_io.put ("Enter value: "); IIO.get (II); text_io.put_line ("Value entered is [" & integer'image (II) & "]."); The only difference I get from my compiler is that with the "'image" version there's an extra space in front of the integer for a sign value. My question is, if you want to output integers mixed with text, and if you don't mind about that first position for the sign, is there really any reason to use an "integer_io" instantiation over just using "integer'image"? It seems like the "'image" version would be more effective, too, since in the other version I'd have to use three I/O calls, versus the one I/O call for the concatentated string. If anybody knows any reason why concatenating "integer'image" might cause me any grief, please let me know. Respond by e-mail if you can; it takes forever for these articles to get to my network. Thanks. ---Kevin Simonson