[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: A bit of help

Jeremy Wilson

5/18/2007 3:54:00 PM

Here is a little chunk of code that may help you

puts 'I am a fortune-teller. Tell me your first name:'
fname = gets.chomp
puts 'What is your last name.'
lname = gets.chomp
puts 'Hello, '+ fname + ' '+ lname + '. ''Your name is a great one!'




-----Original Message-----
From: Acoole Cooland [mailto:andrewchinna@yahoo.co.uk]
Sent: Friday, May 18, 2007 11:47 AM
To: ruby-talk ML
Subject: 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-....