Thread: Exception
View Single Post
  #3 (permalink)  
Old 11-27-2007, 12:50 AM
hardwired's Avatar
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,577
Rep Power: 4
hardwired is on a distinguished road
Default
but im thinking that if there is a null or more sentences (e.g. between the title and the first paragraph) then it gonna stop reading.. what should i do? throw an exception and make it go back to
I'm not sure what you mean by this: "a null or more sentences".
The reader will go on reading until it reaches the end of the file (EOF). When it does it returns "null". With the code you have your while loop will exit gracefully because its listening for this eof condition. If the reader encounters empty lines in the file it will read/return those okay.
Of course you can always whip up a short test app and a file to read and play around with this to find out how it works and what does/doesn't work.
Reply With Quote