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: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Assembling Complex Strings Containing Carriage Returns Prior to Using Ada.Text_IO.Put? Date: Tue, 21 Oct 2014 23:25:21 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <7c1b89e6-9ab8-4faa-b60c-c5c4683f0bff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 22 Oct 2014 06:25:18 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="206f88a41f45fc94d25d07d064d738e2"; logging-data="9491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ro7V+Gon8fKCcYA/KtrSYzIT2AsUAoTE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <7c1b89e6-9ab8-4faa-b60c-c5c4683f0bff@googlegroups.com> Cancel-Lock: sha1:RFqObi/DCag/WGascYsnKRvmXxg= Xref: news.eternal-september.org comp.lang.ada:22653 Date: 2014-10-21T23:25:21-07:00 List-Id: On 10/21/2014 10:57 PM, NiGHTS wrote: > > Complex_String : Ada.Strings.Unbounded.Unbounded_String; > EOL : String := ASCII.CR'Img; I presume you're using GNAT; this gives you the image of the enumeration value CR; I suspect you want the enumeration value (character) itself. Try using EOL : constant Character := Ada.Characters.Latin_1.CR; 'Img is a non-standard, vendor-dependent attribute; you should not use it in production code if you have any interest in portability. ASCII is an obsolete unit and should not be used. What system uses CR for line terminators these days? I suspect the result will not be what you expect, which is why a better approach would be to actually convert this to Ada and simply use a series of Put_Line statements, rather than trying to copy the mistakes of C in Ada. > The searches I performed on Google seem to be void of any hints on how to get this working. I can't imagine that I am the only one with this requirement in Ada. That's because this is not the Ada Way. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17