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,1f78990666319a12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: mieville@mac.com Newsgroups: comp.lang.ada Subject: Re: range in ascii Date: 31 Mar 2005 01:37:08 -0800 Organization: http://groups.google.com Message-ID: <1112261828.853505.238490@f14g2000cwb.googlegroups.com> References: <1111505197.604268.101910@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: 156.106.192.16 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1112261834 9494 127.0.0.1 (31 Mar 2005 09:37:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 31 Mar 2005 09:37:14 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=156.106.192.16; posting-account=TiY6Yg0AAAASQiwqwF9DP5QCjxuqoOQw Xref: g2news1.google.com comp.lang.ada:10178 Date: 2005-03-31T01:37:08-08:00 List-Id: Hi all, I now have my code to count frequency of letters in a text but I do not know how to read the command "enter" after I write my text. What I have now is CTRL+Q but of course is not an elegant solution and I know there is something easy but I cannot find it. Here below is my code if someone could help me in that single question I would be grateful. many thanks - sibyl with Text_Io; use Text_Io; with Ada.Integer_Text_Io; use Ada.Integer_Text_Io; procedure Comptelettretest is Char , char2 : Character; cod: integer ; subtype Lettre is Integer range 20..255; type Freq_Lettre is array (Lettre) of Integer; Count : Freq_Lettre:= (others => 0); begin Put_Line ("Entrer un text au choix et le terminer par 'CTRL/Q' et 'enter' "); loop Get(Char); --how to escape from this instruction, I want to hit enter and have the list. exit when Char = ASCII.DC1; cod := CHARACTER'POS(CHAR); if cod in Lettre then Count(cod) := Count (cod) +1; end if; end loop; New_Line; Put_Line("Frequence des lettres"); New_Line; for cod in Lettre loop char2 := CHARACTER'VAL(cod); Put(char2); put(Count(cod)); New_Line; end loop; end Comptelettretest;