comp.lang.ada
 help / color / mirror / Atom feed
From: nobody@REPLAY.COM (Anonymous)
Subject: Re: Text control characters
Date: 1997/09/11
Date: 1997-09-11T00:00:00+00:00	[thread overview]
Message-ID: <199709111334.PAA16964@basement.replay.com> (raw)
In-Reply-To: uden6xytd8.fsf@tanana.llnl.gov


On 10 Sep 1997 10:24:35 -0700, woodruff@tanana.llnl.gov (John Woodruff)
wrote:
..
> 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?

The definition of a line terminator is outside the Ada language
definition, being platform dependent. I don't remember of the POSIX-Ada
bindings address this, and don't have them available to check. One could
do

generic -- Multi_Line_String_Handler
   Max_Line : Positive;
package Multi_Line_String_Handler is
   subtype Line is String (1 .. Max_Line);

   type Multi_Line_String is array (Positive range <>) of Line;

   procedure Put (Item : in Multi_Line_String);
end Multi_Line_String_Handler;

package MLS is new Multi_Line_String_Handler (Max_Line => 6);

Output : constant MLS.Multi_Line_String := ("line 1", "line 2");
..
Put (Item => Output);

and be platform independent.

Jeff Carter  PGP:1024/440FBE21
My real e-mail address: ( carter @ innocon . com )
"English bed-wetting types."
Monty Python & the Holy Grail

Posted with Spam Hater - see
http://www.compulink.co.uk/~net-services/spam/




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

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

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