M
Mason Kelsey
[Note: parts of this message were removed to make it a legal post.]
I'm having difficulty getting any command to work to pick up input from a
screen or what looks like a DOS box when I run a script from SciTE. In the
following code, which you will recognize as a slightly modified
"basic_client. rb" from Chapter 12 of Beginning Ruby:
require 'bot'
#bot = Bot.new
name => ARGV[0], :data_file => ARGV[1])
bot = Bot.new
name => "No Sam", :data_file => "bot_data")
puts bot.greeting
while input = $stdin.gets and input.chomp != 'end'
puts '>> ' + bot.response_to(input)
end
puts bot.farewell
I get the the thing that looks like a DOS Box appear but it is locked up and
I am unable to input anything. When I kill it by clicking on the close
button, I get the message:
I have tried just using the gets by itself without the $stdin. with the same
failure. Do I have to execute this from outside of SciTE? Then where? I
am running Windows XP. Unfortunately, "Beginning Ruby" does a lite job on
input from monitors. The way gets is described, on page 203 of the book,
just does not work.
Anyway, what is the point for SciTE to display the thing that looks like a
DOS Box if it is always locked up?
I bet that the problem is something stupid I am not noticing. Enjoy
revealing my ignorance! And thanks.
No Sam
I'm having difficulty getting any command to work to pick up input from a
screen or what looks like a DOS box when I run a script from SciTE. In the
following code, which you will recognize as a slightly modified
"basic_client. rb" from Chapter 12 of Beginning Ruby:
require 'bot'
#bot = Bot.new
bot = Bot.new
puts bot.greeting
while input = $stdin.gets and input.chomp != 'end'
puts '>> ' + bot.response_to(input)
end
puts bot.farewell
I get the the thing that looks like a DOS Box appear but it is locked up and
I am unable to input anything. When I kill it by clicking on the close
button, I get the message:
ruby basic_client.rb Hi. I'm No Sam. Want to chat?
Exit code: -1073741510
I have tried just using the gets by itself without the $stdin. with the same
failure. Do I have to execute this from outside of SciTE? Then where? I
am running Windows XP. Unfortunately, "Beginning Ruby" does a lite job on
input from monitors. The way gets is described, on page 203 of the book,
just does not work.
Anyway, what is the point for SciTE to display the thing that looks like a
DOS Box if it is always locked up?
I bet that the problem is something stupid I am not noticing. Enjoy
revealing my ignorance! And thanks.
No Sam