From: "John C." Date: 2001-12-23T16:37:12+09:00 Subject: [ruby-talk:29348] Re: Simple Console IO question Hal E. Fulton wrote: > ----- Original Message ----- > From: John C. > Newsgroups: comp.lang.ruby > To: ruby-talk ML ; > Sent: Sunday, December 23, 2001 12:37 AM > Subject: [ruby-talk:29346] Simple Console IO question > > > >>I am in the process of attempting to learn Ruby (again) >>and have a question that I could not find an answer to in the >>Pickaxe book (1st edition). >> >>Page 107 gives a simple example: >> >>print "enter your name: " >>name = gets >> >>My question is this: When running this, the cursor moves to >>the next line for input. How do I keep it on the same line >>as the printed "enter your name: " so that it looks like: >> >>Enter your name: _ >> >>instead of: >> >>Enter your name: >>_ >> >> >>I played around with a few def statements and read about half >>the book, but I couldn't solve this on my own. >> > > That's odd, because as you've written it, it > should behave as you want (cursor at end of > first line). > > It's always done that for me, both Unix and Windows. > > Are you running in irb or something? > > Hal > Actually, RubyWin, and that's what shows in the console within RubyWin (version 1.65-2) I never tried it from the W2K command lline... Lo and behold, it works as expected... Thanks for making me think about it :-) It's getting late and my brain is fading. Regards, John C.