comp.lang.ada
 help / color / mirror / Atom feed
From: "DuckE" <nospam_steved@pacifier.com>
Subject: Re: Character Handling
Date: 2000/04/30
Date: 2000-04-30T00:00:00+00:00	[thread overview]
Message-ID: <390c5836.0@news.pacifier.com> (raw)
In-Reply-To: 390D1159.83CAEA7F@cantech.net.au

The function To_Upper is a function that takes a string as an argument and
returns a string.  Here's a working sample program that uses
Ada.Characters.Handling.To_Upper:

-- == Start of file: DemoHandling.adb =========
WITH Ada.Characters.Handling;

WITH Ada.Text_Io;

PROCEDURE DemoHandling IS

PACKAGE Text_Io RENAMES Ada.Text_Io;

PACKAGE Handling RENAMES Ada.Characters.Handling;

inputText : String(1..80);

lastIndex : Natural;

BEGIN

Text_Io.Put( "Enter Text > " );

Text_Io.Get_Line( inputText, lastIndex );

DECLARE

ucText : String := Handling.To_Upper( inputText(1..lastIndex) );

lcText : String := Handling.To_Lower( inputText(1..lastIndex) );

BEGIN

Text_Io.Put_Line( "Upper case: " & ucText );

Text_Io.Put_Line( "Lower case: " & lcText );

END;

END DemoHandling;

--========End of File: DemoHandling.adb=============

I hope this helps,
SteveD

"Robert Stephen Breen" <emages@cantech.net.au> wrote in message
news:390D1159.83CAEA7F@cantech.net.au...
> 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
>
> could someone please explain!!!!!!!!!!!!!!!!!
>
> Thanks
> Rob
>






  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 ` Marin D. Condic
2000-04-30  0:00 ` DuckE [this message]
2000-04-30  0:00 ` Ken Garlington
replies disabled

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