comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Help regarding Help File
Date: 1998/05/27
Date: 1998-05-27T00:00:00+00:00	[thread overview]
Message-ID: <m3hg2bs57h.fsf@mheaney.ni.net> (raw)
In-Reply-To: 356cec31.0@cactus


"rvr@Networx.net.au" (Bexley) writes:

>    procedure Help is
>       Help_char:character ;
>    begin
>       Open(Help_File,In_File,"tax.hlp");
>       while not End_Of_File (Help_File) loop
>          Get(Help_File,Help_Char);
>          Put(Help_Char);
>       end loop; --end_of_file loop
>       Close(Help_File);
>    end Help;
> 
> the problem is that this code isn't moving to the next line when the text in 
> the file is..

The problem is that Get (F, C) silently consumes the end-of-line
terminator.  One solution is to just read in a line, and output a
terminator yourself, ie

procedure Help is
   Line : String (1 .. 80);
   Last : Natural;
begin
   while not End_Of_File (F) loop

      loop
         Get_Line (F, Line, Last);
         Put (Line (1 .. Last));
         exit when Last < Line'Last;
      end loop;
  
      New_Line;

   end loop;
end Help;






      reply	other threads:[~1998-05-27  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-28  0:00 Help regarding Help File rvr@Networx.net.au
1998-05-27  0:00 ` Matthew Heaney [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