Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no such element help

 
Dustin Schreader
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble figuring out what I'm doing wrong that I'm getting the error no line found. Here is my code. I'm having the problem on line 120 and 19
 
Ralph Cook
Ranch Hand
Posts: 479
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, at a quick guess, there are no more lines in the file you're reading...
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before reading next line of the Scanner, check whether they exist using hasNextLine() method. So all your below nextLine() should have a hasNextLine() check and the nextInt() should have hasNextInt() check.

 
Dustin Schreader
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you that helped!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic