A bit of help

Ok say i was using this code using SciTE

puts 'Hello there, and what\'s your name?'
name = gets
puts 'Your name is ' + name + '? What a lovely name!'
puts 'Pleased to meet you, ' + name + '. :)'

After i input my name in the gets, and press enter it just skips the
rest of the program and closes it!

Whats wrong?

Thanks,

···

--
Posted via http://www.ruby-forum.com/.

Hi,

I don't use SciTE, but it is probably running so fast you do not see
it and then closes.

Try this.

puts 'Hello there, and what\'s your name?'
name = gets
puts 'Your name is ' + name + '? What a lovely name!'
puts 'Pleased to meet you, ' + name + '. :)'
gets

Just put the 'gets' at the end.
That will make the program wait for you to enter something.

Harry

···

On 5/19/07, Acoole Cooland <andrewchinna@yahoo.co.uk> wrote:

Ok say i was using this code using SciTE

puts 'Hello there, and what\'s your name?'
name = gets
puts 'Your name is ' + name + '? What a lovely name!'
puts 'Pleased to meet you, ' + name + '. :)'

After i input my name in the gets, and press enter it just skips the
rest of the program and closes it!

Whats wrong?

Thanks,

--

A Look into Japanese Ruby List in English

What's wrong is that you're not fast enough to read the message before,
a microsecond or three later, the computer realizes that the program
has exited and closes the window.

-s

···

In message <71a310f00cdb6c964d3985874131164a@ruby-forum.com>, Acoole Cooland writes:

Ok say i was using this code using SciTE

puts 'Hello there, and what\'s your name?'
name = gets
puts 'Your name is ' + name + '? What a lovely name!'
puts 'Pleased to meet you, ' + name + '. :)'

After i input my name in the gets, and press enter it just skips the
rest of the program and closes it!

Whats wrong?

Oh my god!, it worked Thank you guys so much. Ruby-Forum rules!

Thanks,
-Acoole

···

--
Posted via http://www.ruby-forum.com/.