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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e61c8636ef35379d X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Escape Sequences in Strings Date: 2000/11/15 Message-ID: <8uub09$9sr$1@nnrp1.deja.com>#1/1 X-Deja-AN: 693929225 References: <3A17B0E2@MailAndNews.com> <3A1275A2.F2A843E9@bton.ac.uk> X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 166.72.70.94 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Nov 15 15:44:11 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-11-15T00:00:00+00:00 List-Id: In article <3A1275A2.F2A843E9@bton.ac.uk>, John English wrote: > Escape sequences are easy enough: > Ada.Text_IO.Put(ASCII.ESC & "[2J"); -- clear the screen But we would never want to do that in a program, and indeed Ada here helps us avoid the nasty habit of embedding odd escape sequences in strings in C without any comments, often with a result of making the program non-portable. The proper coding in Ada would be: Clear_Screen : constant String := ASCII.ESC & "[2J"; -- ANSI escape sequence for clearing screen. Modify to -- meet requirements of your system. Put (Clear_Screen); It is almost always wrong to have mysterious constants in code! Sent via Deja.com http://www.deja.com/ Before you buy.