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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,37c1f61bd0b7914 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mail From: george.priv@gmail.com Newsgroups: comp.lang.ada Subject: Re: Converting Type Characters to type string Date: Sun, 30 Mar 2008 20:04:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8f5967a7-17ab-4eda-80fc-5cb58ae011f5@s50g2000hsb.googlegroups.com> References: <1206913712.22025.8.camel@K72> <32899fde-7bbb-403d-8d14-fd19b10f81ee@13g2000hsb.googlegroups.com> NNTP-Posting-Host: 151.196.71.114 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1206932678 10612 127.0.0.1 (31 Mar 2008 03:04:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 31 Mar 2008 03:04:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s50g2000hsb.googlegroups.com; posting-host=151.196.71.114; posting-account=VnNb3AoAAACTpRtCcTrcjmPX7cs92k1Q User-Agent: G2/1.0 X-HTTP-Via: 1.1 SPARKS X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20660 Date: 2008-03-30T20:04:38-07:00 List-Id: On Mar 30, 7:52 pm, jedivaughn wrote: > Thanks for the suggestions but I'm not quite sure how I would apply > these to my program can you give me an example in code? > > Thanks for your patience > John procedure Test_Get is Str : String (1 .. 10) := (others => ' '); Index : Natural := 0; C : Character; begin while index < Str'Last loop Ada.Text_IO.Get (C); -- This check can be different according to your needs: exit when not Ada.Characters.Handling.Is_Digit (C); Index := Index + 1; Str (Index) := C; end loop; Ada.Text_IO.Put_Line (Str); end Test_Get; But I would rather use Get_Line instead of Get to get entire string and then figure out what to do with it. George.