comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: range in ascii
Date: Thu, 31 Mar 2005 19:15:44 GMT
Date: 2005-03-31T19:15:44+00:00	[thread overview]
Message-ID: <A%X2e.2930$x4.2890@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <1112261828.853505.238490@f14g2000cwb.googlegroups.com>

mieville@mac.com wrote:

>    type Freq_Lettre is array (Lettre) of Integer;

Integer allows negative values, so I guess negative frequencies are 
meaningful? If not, perhaps you should use Natural.

Why not use

    subtype Lettre is Character range 'x' ... 'z'; -- or whatever

and avoid the conversions between Characters and Integers?

>    Put_Line ("Entrer un text au choix et le terminer par 'CTRL/Q' et
> 'enter' ");

      Read_Input : declare
         Line : constant String := PragmARC.Get_Line;
      begin
         All_Chars : for I in Line'range loop
            if Line (I) in Lettre then
               Count (Line (I) ) := Count (Line (I) ) + 1;
            end if;
         end loop All_Chars;
      end Read_Input;

The PragmAda Reusable Components are available from

http://home.earthlink.net/~jrcarter010/pragmarc.htm

-- 
Jeff Carter
"I unclog my nose towards you."
Monty Python & the Holy Grail
11



  parent reply	other threads:[~2005-03-31 19:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 15:26 range in ascii mieville
2005-03-22 15:43 ` Peter Hermann
2005-03-31  9:37   ` mieville
2005-03-31 10:52     ` Anders Wirzenius
2005-03-31 11:23       ` Alex R. Mosteo
2005-03-31 19:15     ` Jeffrey Carter [this message]
2005-03-22 17:32 ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox