SciTE problem with gets method

Discussion in 'Ruby' started by Hakusa@gmail.com, May 20, 2007.

  1. Guest

    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?
     
    , May 20, 2007
    #1
    1. Advertising

  2. 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
     
    Stefan Mahlitz, May 20, 2007
    #2
    1. Advertising

  3. Guest

    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.
     
    , May 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefan Mueller
    Replies:
    5
    Views:
    541
    Steven Saunderson
    Jul 10, 2006
  2. John Joyce

    gets gets

    John Joyce, Mar 26, 2007, in forum: Ruby
    Replies:
    2
    Views:
    374
    John Joyce
    Mar 26, 2007
  3. John Joyce

    Return of gets gets

    John Joyce, Apr 23, 2007, in forum: Ruby
    Replies:
    0
    Views:
    211
    John Joyce
    Apr 23, 2007
  4. Jeffrey Van alstine

    SciTE Hangs with gets()

    Jeffrey Van alstine, Aug 2, 2009, in forum: Ruby
    Replies:
    3
    Views:
    139
    Jeffrey Van alstine
    Aug 4, 2009
  5. libsfan01
    Replies:
    5
    Views:
    266
    Jeff North
    Dec 20, 2006
Loading...

Share This Page