« Return to Thread: How to detect End of file

How to detect End of file

by nope n :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi everyone,


I have difficulties detecting the EOF when I press ctrl-D at the netbeans output window.

Here is the code I am using for detecting eof when pressing ctrl-D:


def main(args: Array[String]) = {
    var line:String = ""
    do{
        line = readLine()
        println(line)
    }while(line != null)
  }


When using Ctrl + D, the loop doesn't end and the code that follows the loop is not executed.


thank you,

Francisco Perez



Create a cool, new character for your Windows Liveā„¢ Messenger. Check it out

 « Return to Thread: How to detect End of file