comp.lang.ada
 help / color / mirror / Atom feed
From: woodruff@tanana.llnl.gov (John Woodruff)
Subject: Text control characters
Date: 1997/09/10
Date: 1997-09-10T00:00:00+00:00	[thread overview]
Message-ID: <uden6xytd8.fsf@tanana.llnl.gov> (raw)



By coincidence, Jeff Meyer asked a question on this forum that is a
topic I have been puzzling.  He wants a multi-line text box; I want
multiple lines in a string constant.  Maybe one answer fits all ...

I can construct some function that returns a string.  I wish to compose
such functions in a way to make a textual report, and deliver that
report as a string.  I wish I could format the string into lines in a
way to make it relatively easy to read.  

The caller of this function may very well choose to Ada.Text_IO.Put the
string into a file, or perhaps might use the string in some other way.

How can I construct a string so that Put will produce line_terminators
in the output?  

Example:
  output : constant string := "line 1 " & <*what goes here?*> & "line 2";

  -- I want the result of 
  Ada.Text_IO.Put (output) ; 
  -- to be 
line 1
line 2

Partial answer:  if I use

    ada.characters.latin_1.CR & ada.characters.latin_1.LF 

this works on some operating system.  Is there a standard-compliant way
to solve the problem in general?

--
John Woodruff                                             N I F   \ ^ /
Lawrence Livermore National Lab                         =====---- < 0 >
510 422 4661                                                      / v \




             reply	other threads:[~1997-09-10  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-10  0:00 John Woodruff [this message]
1997-09-11  0:00 ` Text control characters Anonymous
1997-09-11  0:00 ` Dale Stanbrough
1997-09-12  0:00   ` Robert A Duff
1997-09-15  0:00     ` Larry Kilgallen
1997-09-12  0:00   ` Stephen Leake
1997-09-12  0:00     ` Robert A Duff
1997-09-13  0:00   ` Tarjei T. Jensen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox