comp.lang.ada
 help / color / mirror / Atom feed
From: "Tarjei T. Jensen" <tarjei@online.no>
Subject: Re: Text control characters
Date: 1997/09/13
Date: 1997-09-13T00:00:00+00:00	[thread overview]
Message-ID: <341A7B18.3D9A@online.no> (raw)
In-Reply-To: 5v9vj1$dge$1@goanna.cs.rmit.edu.au


>Dale Stanbrough wrote:
> package Unix.Line_Terminators is
>    Line_Terminator : constant String := Ascii.LF & "";
> 
> end;
> 
> with Unix.Line_Terminators;
> package OS.Line_Terminators is
> 
>    Line_Terminator : String renames Unix.Line_Terminators.Line_Terminator;
> 

> end;
> 
> and then get your configuration system to choose the appropriate with
> (maybe even use a preprocessor! to select a with statement).
> 
> Thinking about it, the preprocessor selection of a with statement
> would seem to be a fairly benign use of preprocessors. Can anyone see
> any great harm in this scheme?
> 

You have not solved the problem.

The problem is that CR an LF is not recognized as control characters on
a PC Ada implementation. The I/O system probably pokes the characters
straight to the screen instead of doing a carriage return and line feed.

The easiest way of working around the problem is probably by using a
dynamic array of strings or pointers to strings. If one want to save
overhead one could use one dynamic array with pointers (high, low) to
text fragments in an character array.

One would write the text to the screen in the normal way and put in
explicit calls to do newlines.

Greetings,

-- 
// Tarjei T. Jensen 
//    tarjei@online.no || voice +47 51 62 85 58
//   Support you local rescue centre: GET LOST!




  parent reply	other threads:[~1997-09-13  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   ` 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 [this message]
1997-09-11  0:00 ` Anonymous
replies disabled

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