SciTE problem with gets method

H

Hakusa

I just today started out with Ruby and when I tried to use the gets
method, I get a black box with a blinking cursor in it. Nothing
happens when I press any buttons.

Why?
 
S

Stefan Mahlitz

I just today started out with Ruby and when I tried to use the gets
method, I get a black box with a blinking cursor in it. Nothing
happens when I press any buttons.


print("Enter some text: ")
$stdout.flush
input = gets
puts("You entered <#{input}>")

Running in SciTE it open a cmd prompt (where the ruby interpreter is
called).

Output goes to SciTE-output pane - so you can ignore the cmd-window.
Just switch back to SciTE to enter the data and see the output.

Stefan
 
H

Hakusa

That works!

I actually had tried this before, but I think the confusion came from
using the variable x and not the one I had just defined that made the
error message so confusing. I guess I should stop my 2AM coding
sessions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top