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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Assembling Complex Strings Containing Carriage Returns Prior to Using Ada.Text_IO.Put? Date: Wed, 22 Oct 2014 08:28:46 +0200 Organization: A noiseless patient Spider Message-ID: <87d29kfwip.fsf@ludovic-brenta.org> References: <7c1b89e6-9ab8-4faa-b60c-c5c4683f0bff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="3840f4e13018603d11d93dd1034814ef"; logging-data="9713"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aLFTTL2yQ+D9lrQBJRqWX" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:lz7rIB0uBLA0qLbewg9JxAvL9v0= sha1:UgC0ZK+GPe4vGUS7k0q6SEOOMIg= Xref: news.eternal-september.org comp.lang.ada:22654 Date: 2014-10-22T08:28:46+02:00 List-Id: mockturtle writes: > On Wednesday, October 22, 2014 7:57:39 AM UTC+2, NiGHTS wrote: >> I am converting some code from C to Ada which involves building a >> complex string containing '\n' characters which would eventually be >> displayed on the standard output console using the printf() >> function. [...] >> EOL : String := ASCII.CR'Img; [...] > EOL : constant Character := ASCII.CR; '\n' is not ASCII.CR, it is ASCII.LF, by the way. And on some nonstandard platforms, the C compiler translates '\n' into a sequence of two characters, ASCII.CR & ASCII.LF. -- Ludovic Brenta.