comp.lang.ada
 help / color / mirror / Atom feed
* END_ERROR on Text_Io.Get
@ 1989-03-01 21:56 ylarotiala
  1989-03-04 19:51 ` Gordon V. Cormack
  0 siblings, 1 reply; 2+ messages in thread
From: ylarotiala @ 1989-03-01 21:56 UTC (permalink / 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
   

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1989-03-04 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-03-01 21:56 END_ERROR on Text_Io.Get ylarotiala
1989-03-04 19:51 ` Gordon V. Cormack

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