From: Wannabe h4x0r <chris@dont.spam.me>
Subject: Ada Characters?
Date: Thu, 28 Feb 2002 02:07:44 GMT
Date: 2002-02-28T02:07:44+00:00 [thread overview]
Message-ID: <Qhgf8.10877$mG.44556@rwcrnsc54> (raw)
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.
Now, I got a short program that opens a text file, and reads from it, but
all it does is spew out control codes. Really odd. I really dont have a
handle on this as I can tell.
Tips?
Chris
next reply other threads:[~2002-02-28 2:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-28 2:07 Wannabe h4x0r [this message]
2002-02-28 2:28 ` Ada Characters? 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox