comp.lang.ada
 help / color / mirror / Atom feed
* Ada Characters?
@ 2002-02-28  2:07 Wannabe h4x0r
  2002-02-28  2:28 ` Jim Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Wannabe h4x0r @ 2002-02-28  2:07 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-03-06  1:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox