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,37c1f61bd0b7914 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!club-internet.fr!feedme-small.clubint.net!fdn.fr!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Message-ID: <47EFF5DF.401@obry.net> Date: Sun, 30 Mar 2008 22:19:43 +0200 From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 Newsgroups: comp.lang.ada To: jedivaughn Subject: Re: Converting Type Characters to type string References: <45128c93-6001-47bd-9feb-d82ac04a5515@k13g2000hse.googlegroups.com> In-Reply-To: <45128c93-6001-47bd-9feb-d82ac04a5515@k13g2000hse.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Date: 30 Mar 2008 22:19:44 CEST NNTP-Posting-Host: 90.35.80.245 X-Trace: 1206908384 news.orange.fr 880 90.35.80.245:2206 X-Complaints-To: abuse@orange.fr Xref: g2news1.google.com comp.lang.ada:20647 Date: 2008-03-30T22:19:44+02:00 List-Id: jedivaughn a �crit : > I am looking for a way to convert a group of characters to a string. > For the program I am writing I am having the user input a group of > characters and comparing them. But I also need the characters in the > form of a string later on so I can use > > int := Integer'Value(str); Looks like bad C habit to me :) In Ada a String is defined as: type String is array (Positive range <>) of Character; So in your case you have something like this: C : Character; Get (C); To get characters from user. Now to store them. Let's say you are going to check 10 characters max: Str : String (1 .. 10); Index : Natural := 0; To store each character: Get (C); Index := Index + 1; Str (Index) := C; At the end, Str (1 .. Index) contains all the characters entered by the user as a string. Looks like this is what you are looking for, right? Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595