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-7-bit Path: g2news1.google.com!postnews.google.com!d4g2000prg.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: Converting Type Characters to type string Date: Sun, 30 Mar 2008 14:28:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9a53e3af-c664-4db7-9f8e-496218aaf8a2@d4g2000prg.googlegroups.com> References: <45128c93-6001-47bd-9feb-d82ac04a5515@k13g2000hse.googlegroups.com> <47EFF5DF.401@obry.net> NNTP-Posting-Host: 75.70.240.233 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1206912491 13564 127.0.0.1 (30 Mar 2008 21:28:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 30 Mar 2008 21:28:11 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d4g2000prg.googlegroups.com; posting-host=75.70.240.233; posting-account=fZH-XgkAAADP-Rf8L8ppyFIdKUfh90k4 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; 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:20651 Date: 2008-03-30T14:28:11-07:00 List-Id: On Mar 30, 3:08 pm, jedivaughn wrote: > number 1 thank you so much for the fast response. But when I try your > suggestion and use say "1234" for the input I get the number 1, a few > spaces, and then some smiley faces. not exactly what I was hoping > for :) . Here's my code if that's any help. > > with ada.text_IO, ada.integer_text_IO; > > procedure integers is > > index : natural :=0; > char : character; > str : string (1..10); > > begin > > ada.text_IO.put("Please enter a few Integers "); > ada.text_IO.get(char); > > Index := Index + 1; > Str(Index) := Char; > ada.text_IO.put(str); > > end integers; Your example contains no loop, so it only gets a single character. Ada strings are not null terminated like C strings. They are fixed length data items. A proper output of the character you collected is Ada.Text_IO.Put(Str(1..Index)); Jim Rogers