From: Helgitomas Gislason Date: 2007-03-22T03:29:42+09:00 Subject: Re: Exiting in the middle of the program Errm... That does not tell me what code to put in the program to exit it... Example: 1. puts 'Hello there' 2. puts 'What\'s your name?' 3. puts ' ' 4. name = gets.chomp 5. puts ' ' 6. 7. if name == 'John' 8. puts 'Nice name!' 9. end 10. 11. if name == 'Mary' 12. puts 'What a beautiful name!' 13. end Now. If I'd like to exit the program without typing the name, just say "exit", what code should I put? Can I only say: if name == 'exit' exit end ? -- Posted via http://www.ruby-forum.com/.