comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin D. Condic" <mcondic-nospam@quadruscorp.com>
Subject: Re: Character Handling
Date: 2000/04/30
Date: 2000-04-30T14:26:40+00:00	[thread overview]
Message-ID: <390C6C3F.90685791@quadruscorp.com> (raw)
In-Reply-To: 390D1159.83CAEA7F@cantech.net.au

Robert Stephen Breen wrote:
> 
> Hi everyone,
> I am currently working on an assigment at uni and I have to convert a
> String input to upper case. I have discovered that package
> Characters.Handling will do the trick, however mebe its because I am
> Irish, but I can not make heads or tails of how you actually use it in
> your code!
> 
> I have put
> 
> With Text_io,Ada.Characters.Handling;
> Use Text_io;
> 
> and in one of my procedures I have tried to convert an input.
> 
> Ada.Characters.Handling.To_upper(Clients_Name(Name_Last)) etc
> 
> all I get is a message stating Ivalid parameter call ? How
> 
You don't have sufficient information here to diagnose the exact
problem. The answer is that it depends o what the function (I'm
presuming its a function) Clients_Name returns. A correct usage of the
call would be:

....
String_1 : String (1..10) := "abcdefghik" ;
String_2 : String (1..10) ;
....
String_2 := Ada.Characters.Handling.To_Upper (String_1) ;
....


Note that the sizes and types of both String_1 and String_2 match. Note
that they are of the type "String" which is the expected type as an
input parameter to the function "To_Upper". Ada is very fussy that all
the types match. It may seem like a pain, but this is how Ada can catch
otherwise hard to diagnose errors in program logic.

If you need additional examples, I've got lots of Ada code on my web
page. Look specifically at the code under  GNAT_Examples.chop where I
have lots of small programs that illustrate basic Ada features.

MDC
-- 
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

"I'd trade it all for just a little more"
    --  Charles Montgomery Burns, [4F10]
======================================================================




      parent reply	other threads:[~2000-04-30  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-30  0:00 Character Handling Robert Stephen Breen
2000-04-30  0:00 ` DuckE
2000-04-30  0:00 ` Ken Garlington
2000-04-30  0:00 ` Marin D. Condic [this message]
replies disabled

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