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-28 15:15:41 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news-x2.support.nl!newsfeeds.belnet.be!news.belnet.be!news-hub.siol.net!zur.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Ada Characters? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3C7EB50D.3D004054@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Thu, 28 Feb 2002 22:54:05 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:20612 Date: 2002-02-28T22:54:05+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; > > 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