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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,88c932f716f86f68 X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Integer to String Conversion? Date: 1998/12/16 Message-ID: <3677C46A.FFC450C0@pwfl.com>#1/1 X-Deja-AN: 422884921 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <756ue7$7o3$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1998-12-16T00:00:00+00:00 List-Id: bwefler@my-dejanews.com wrote: > > Does anyone know an Ada-83 compatible method to convert an integer to a > string, so that the string may be concatenated with another string, and the > resulting string passed as a parameter to a function call? (Note: I am not > talking about using Text_IO or Integer_IO in this case; I simply want the > result to be a string. Another function will take care of the string.) > The usual way is with the 'Image attribute, but you may need to exercise a little caution, given that it is defined to return either a leading minus sign or a leading space and in either case, whatever you pass it to has to deal with that appropriately. See the Ada83 LRM, 3.5.5(10) For the type "Integer" and an object "X" of type "Integer" you would have a function like this: Integer'Image (X) This will return the character string. There is also, within Text_IO.Integer_IO a procedure "Put" which can put an integer into a string, rather than to a file. This is typically more work than the 'Image solution. MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 Ph: 561.796.8997 Fx: 561.796.4669 ***To reply, remove "bogon" from the domain name.*** "Eagles may soar, but a weasle never gets sucked up into a jet engine." -- Author Unknown