From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48376c7ba742841e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-27 18:28:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!wn3feed!worldnet.att.net!135.173.83.72!wnfilter2!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C7D95C5.5040006@worldnet.att.net> From: Jim Rogers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Characters? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 28 Feb 2002 02:28:11 GMT NNTP-Posting-Host: 12.86.35.52 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1014863291 12.86.35.52 (Thu, 28 Feb 2002 02:28:11 GMT) NNTP-Posting-Date: Thu, 28 Feb 2002 02:28:11 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:20545 Date: 2002-02-28T02:28:11+00:00 List-Id: 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 then > NEW_LINE; > else > NULL; > end if; > else > Put(chk_char); --Put each character individually > end if; > end loop; with Ada.Characters.Latin_1; with Ada.Characters.Handling; use Ada.Characters.Handling; ... for l in TEXT'range loop chk_char := TEXT(l); if Is_Control(chk_char) then if chk_char = Ada.Characters.Latin_1.LF then Ada.Text_IO.Put(chk_char); end if; else Ada.Text_IO.Put(chk_char); end if; end loop; Jim Rogers