comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: Ada Characters?
Date: Thu, 28 Feb 2002 22:54:05 GMT
Date: 2002-02-28T22:54:05+00:00	[thread overview]
Message-ID: <3C7EB50D.3D004054@boeing.com> (raw)
In-Reply-To: Qhgf8.10877$mG.44556@rwcrnsc54

Wannabe h4x0r wrote:
> 
> I'm trying to figure out how to get my Ada program to single out ASCII
> control codes without hosing the output of the rest of the text file.
> 
> Basically, I'm doing it like this...
> with Ada.Characters; use Ada.Characters.Handling;
> 
>         TEXT : string(1..200);
>         chk_char: character;  -- Check to see if this is a control character.
>         chk_result : boolean;
> 
> and the code goes like this ...
> 
>         for l in TEXT'range loop
>                 chk_char := TEXT(l);
>                 chk_result := Is_control(chk_char);
>                         if chk_result is True then
>                                 if <how do I check to see if it's a NL(new line) character?> then
>                                         NEW_LINE;
>                                 else
>                                         NULL;
>                                 end if;
>                         else
>                                 Put(chk_char); --Put each character individually
>                         end if;
>         end loop;
> 
> Anyways, that's the general gist of it.

I don't understand what you're trying to do. How do you fill Text and
how does it get control characters in it? What character do you mean by
NL? No such character is defined in Ada.Characters.Latin_1. Ada.Text_IO
line terminators are not defined by the language and differ from OS to
OS; on some systems a line terminator is a single character while on
others it is a sequence of characters.

-- 
Jeffrey Carter



      parent reply	other threads:[~2002-02-28 22:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-28  2:07 Ada Characters? Wannabe h4x0r
2002-02-28  2:28 ` Jim Rogers
2002-02-28  2:37 ` sk
2002-02-28 13:16 ` Georg Bauhaus
2002-02-28 19:30   ` Wannabe h4x0r
2002-03-01 10:50     ` Georg Bauhaus
2002-03-05 20:58     ` Nick Roberts
2002-03-06  1:45       ` Wannabe h4x0r
2002-02-28 22:54 ` Jeffrey Carter [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