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 X-Received: by 10.52.188.67 with SMTP id fy3mr4555503vdc.5.1413957459003; Tue, 21 Oct 2014 22:57:39 -0700 (PDT) X-Received: by 10.182.234.44 with SMTP id ub12mr95821obc.14.1413957458854; Tue, 21 Oct 2014 22:57:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!dc16no4571808qab.1!news-out.google.com!ks2ni146igb.0!nntp.google.com!uq10no15375201igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 21 Oct 2014 22:57:38 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.229.110.218; posting-account=wEPvUgoAAABrLeiz_LRhQ3jeEhyfWVMH NNTP-Posting-Host: 71.229.110.218 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7c1b89e6-9ab8-4faa-b60c-c5c4683f0bff@googlegroups.com> Subject: Assembling Complex Strings Containing Carriage Returns Prior to Using Ada.Text_IO.Put? From: NiGHTS Injection-Date: Wed, 22 Oct 2014 05:57:38 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:22650 Date: 2014-10-21T22:57:38-07:00 List-Id: I am converting some code from C to Ada which involves building a complex s= tring containing '\n' characters which would eventually be displayed on the= standard output console using the printf() function.=20 I tried to copy the same strategy of building the string in Ada like this: Complex_String : Ada.Strings.Unbounded.Unbounded_String; EOL : String :=3D ASCII.CR'Img; ... Ada.Strings.Unbounded.Append (Complex_String,=20 "Menu Title" & EOL &=20 "-------------------------------------" & EOL ); ... Ada.Text_Io.Put (=20 Ada.Strings.Unbounded.To_String( Complex_String ) ); Instead of breaking the line in the places where EOL has been inserted, it = seems to show the letters "CR" in its place. Due to the complexity of the f= inal displayed text, I cannot print the text to console before I have run t= hrough the entire code which generates the text. The code I am converting i= nvolves many "Complex_Strings" which are later printed in a specific order = depending on certain criteria only known after the fact. Therefore I need t= o assemble these generated strings along with the carriage returns before d= isplaying them to the user. The searches I performed on Google seem to be void of any hints on how to g= et this working. I can't imagine that I am the only one with this requireme= nt in Ada. Thanks in advance for your advice.