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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5ed7b28464be2e1a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!newshub2.home.nl!newshub1.home.nl!home.nl!not-for-mail From: Andre Newsgroups: comp.lang.ada Subject: Re: Another problems of newbie Date: Thu, 30 Dec 2004 16:30:06 +0100 Organization: @Home Benelux Message-ID: References: NNTP-Posting-Host: cp538812-a.venra1.lb.home.nl Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news2.tilbu1.nb.home.nl 1104420603 14429 84.30.194.114 (30 Dec 2004 15:30:03 GMT) X-Complaints-To: usenet@corp.home.nl NNTP-Posting-Date: Thu, 30 Dec 2004 15:30:03 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:7325 Date: 2004-12-30T16:30:06+01:00 List-Id: maxsio ;D wrote: > I need to write some program and I have problems with it. This program > should read text file, write words to array, sort them and than write to > another text file. In one book I found way how to read only singel char > so I thought it would be easy to link singel char and rest part of final > word, but I was wrong. I've written this subprogram (this program is > reading from keyboard, but with files is similar so...) : > * > 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; > * > but after first letter program generate constraint error. And second > problem which I have is sorting array with words. To sort array I've > choosen QuickSort, but I don't know totally how to use it in Ada. I was > searching in Google, but I found only QuickSort with pointers. > Unfortunately I don't understand how to use them good ind this > algorithm. If anybody could explain usage of pointers in this algorithm > or write QuickSort without pointers I'd be grateful. > Sorry for my poor English and thanks in advance. Greetings > > maxsio word:=word&(string(char)) is a concatenation of the string word and the char. This requiers a sting of 1 .. 32. what you want is: word (i) := char; Andr�