comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: converting lower case to upper case
Date: 1995/04/06
Date: 1995-04-06T00:00:00+00:00	[thread overview]
Message-ID: <dewar.797194203@gnat> (raw)
In-Reply-To: 3ls54b$hu@news1.delphi.com


tmoran says:

"function To_Upper(Item : in Character) return Character is
  Raise_It:constant array('a' .. 'z') of Character
    :="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
begin
  if Item in Raise_It'range then return Raise_It(Item);
  else return Item;
  end if;
end To_Upper;"

this is wrong, it handles only the lower part of the Ada character set,
and not Latin-1 extended characters. It is really quite important in
Ada 95 to abandon this familiar do-it-yourself-its-so-easy idiom for
case convesion, and use the routines in Ada.Characters.Handling. This
little bit of effort will be well paid off in future reuse of your code
in internatational contexts.






  reply	other threads:[~1995-04-06  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-04  0:00 converting lower case to upper case tmoran
1995-04-06  0:00 ` Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-04-01  0:00 Greg Schmitt
1995-04-02  0:00 ` Chris O'Regan
replies disabled

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