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,5ed7b28464be2e1a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Another problems of newbie References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <_OXAd.2484$Cc.1582@newsread3.news.pas.earthlink.net> Date: Thu, 30 Dec 2004 18:30:18 GMT NNTP-Posting-Host: 4.254.202.105 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1104431418 4.254.202.105 (Thu, 30 Dec 2004 10:30:18 PST) NNTP-Posting-Date: Thu, 30 Dec 2004 10:30:18 PST Xref: g2news1.google.com comp.lang.ada:7333 Date: 2004-12-30T18:30:18+00:00 List-Id: maxsio ;D wrote: > procedure chars is > word : string(1..31); > char : character; > > begin > for i in 1..30 loop > Get(char); > word:=word&(string(char)); > end loop; > Put(word); > delay 10.0; > end chars; You have some basic misunderstandings. A String is just an array, so to assign anything to Word, it must be exactly 31 Characters long. Why 31, when you're only reading 30 Characters? Word (31) is undefined. Presumably you're doing this to learn Ada. You should work through a text or tutorial so you understand the basics of the language before working on anything like this. Then when you have problems they'll be at a suitable level for asking here. You can find both texts and tutorials on line at adapower.com and adaworld.com. When you do get to that level, you'll find that reading words is already done for you. See PragmARC.Word_Input and the various sorting packages that are part of the PragmAda Reusable Components. The PragmARCs are available from http://home.earthlink.net/~jrcarter010/pragmarc.htm -- Jeff Carter "Now look, Col. Batguano, if that really is your name." Dr. Strangelove 31