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

short simple stumper: reading doubles from the cli  RSS feed

John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a short program that's supposed to read positive doubles in from the command line as the user types 'em in and hits enter. It's got some very strange behaviour. First, the code:

If I run it on the NT system at work, here's a sampling of what the exchanges look like on the command line:

and it goes on like this without breaking out of the while loop. Very peculiar... worth a few thoughts anyhow.
Stranger still, the file that gets written to looks pretty much right. It doesn't contain those itsy-bitsy numbers noted above but it does however contain the sdfsa letters...
Yes, I realize that when I open theFile.txt with notepad, notepad simply looks at the bytes and interprets them as iso-latin ascii and displays 'em as such... Although I don't know how it get's the carriage return/newlines correct...(?)
Let me know if anybody see's what I'm not. Thanks.

[This message has been edited by john gabriele (edited August 03, 2001).]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!