title: Ada program to detect an end of line
body: <p>I was assigned this task as my homework. I have a file which contains lines of text of varying lengths. The program is supposed to write the data onto the screen in precisely the same order in which it is written in the file, yet it fails to do so. To achieve the desired result I tried reading only one character per iteration so as to detect new line characters. What am I doing wrong?</p>
  
  <pre><code>WITH Ada.Text_IO;
  WITH Ada.Characters.Latin_1;
  USE Ada.Text_IO;
  
  PROCEDURE ASCII_artwork IS
     File : File_Type;
     c : Character;
  BEGIN
     Open(File, In_File, "Winnie_The_Pooh.txt");
     WHILE NOT End_Of_File(File) LOOP
        Get(File, C);
        IF (C = Ada.Characters.Latin_1.LF) THEN Put_Line(" "); ELSE
           Put(C);
        END IF;
     END LOOP;
     Close(File);
  END ASCII_Artwork;
  </code></pre>