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 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: Marin David Condic Subject: Re: Escape Sequences in Strings Date: 2000/11/16 Message-ID: <3A13F04A.6D36C736@acm.org>#1/1 X-Deja-AN: 694336202 Content-Transfer-Encoding: 7bit References: <3A17B0E2@MailAndNews.com> <3A1275A2.F2A843E9@bton.ac.uk> <8uub09$9sr$1@nnrp1.deja.com> <8uump3$s3o$1@news.huji.ac.il> <3A13C41E.FCBDD34C@bton.ac.uk> <8v0m76$1mt1@news.kvaerner.com> X-Accept-Language: en X-Server-Date: 16 Nov 2000 14:32:49 GMT Content-Type: text/plain; charset=us-ascii Organization: Quadrus Corporation Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-11-16T14:32:49+00:00 List-Id: Ken Garlington wrote: > Character C_Escape_Sequence Ada_Equivalent > " \" "" or Ada.Characters.Latin_1.Quotation > ' \' ' or Ada.Characters.Latin_1.Apostrophe > ? \? ? or Ada.Characters.Latin_1.Question > \ \\ \ or Ada.Characters.Latin_1.Reverse_Solidus > BEL \a Ada.Characters.Latin_1.BEL > BS \b Ada.Characters.Latin_1.BS > FF \f Ada.Characters.Latin_1.FF > NL \n Ada.Characters.Latin_1.NL > CR \r Ada.Characters.Latin_1.CR > HT \t Ada.Characters.Latin_1.HT > VT \v Ada.Characters.Latin_1.VT > octal \ddd Character'Val(8#ddd#) > hex \xhh Character'Val(16#hh#) And you can even avoid the verbosity (if desired) using a "use" clause as in: with Ada.Characters.Latin_1 ; use Ada.Characters.Latin_1 ; procedure Demo is Some_String : constant String := "Ring the bell: " & BEL & "New Page: " & FF ; begin null ; end Demo ; Its pretty obvious to us Ada Old Timers, but a newbie might see "Ring the bell: " & Ada.Characters.Latin_1.BEL as so needlessly verbose that they'll run off telling everyone that Ada sucks because they can't write "Ring the bell: \a". If it were true, they'd have a point. Just a small thing - but often something we forget. MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Giving money and power to Government is like giving whiskey and car keys to teenage boys." -- P. J. O'Rourke ======================================================================