comp.lang.ada
 help / color / mirror / Atom feed
From: ylarotiala@cc.helsinki.fi
Subject: END_ERROR on Text_Io.Get
Date: 1 Mar 89 21:56:44 GMT	[thread overview]
Message-ID: <2445@cc.helsinki.fi> (raw)


   I wrote a piece of code:
      
   WHILE NOT Text_Io.End_Of_File(File) LOOP
   	Text_Io.Get(File,C);
   	...
   END LOOP;
   
   I believed that this would just read the File  character  by  character
   but I was wrong. Tests gave results:
   
   1) A file with two lines, text on both
   >first line<EOLN>
   >second line<EOF>
   
   Everything  is  just fine; my program sees the file, reads it and finds
   the end of it.
   
   2) A file with three lines, the third beign empty
   >first line<EOLN>
   >second line<EOLN>
   ><EOF>
   
   This   time   Text_Io.Get  raises  END_ERROR.  LRM(14.3.4)  says  about
   END_OF_FILE:

   "Returns  TRUE  if  file terminator is next, or if the combination of a
   line, a page, and a file terminator is next; otherwise returns  FALSE."

   Does  this  mean that the combination "line and file terminator" is not
   detected? Why is the exception raised?
   
   A. Yl{-Rotiala
   ylarotiala @cc.helsinki.fi	- Helsinki, Finland
   

             reply	other threads:[~1989-03-01 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-03-01 21:56 ylarotiala [this message]
1989-03-04 19:51 ` END_ERROR on Text_Io.Get Gordon V. Cormack
replies disabled

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