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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,47645c013367a8d6 X-Google-Attributes: gid103376,public From: "Tarjei T. Jensen" Subject: Re: Text control characters Date: 1997/09/13 Message-ID: <341A7B18.3D9A@online.no>#1/1 X-Deja-AN: 272129185 References: <5v9vj1$dge$1@goanna.cs.rmit.edu.au> Organization: Jensen programvareutvikling Reply-To: tarjei@online.no Newsgroups: comp.lang.ada Date: 1997-09-13T00:00:00+00:00 List-Id: >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!