[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SciTE problem with gets method

Hakusa@gmail.com

5/20/2007 6:46:00 AM

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?

2 Answers

Stefan Mahlitz

5/20/2007 10:43:00 AM

0

Hakusa@gmail.com wrote:
> 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

Hakusa@gmail.com

5/20/2007 1:35:00 PM

0

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.