From: Giampiero Zanchi Date: 2010-07-27T23:41:35+09:00 Subject: Re: stop program with entering a key... def menu p "Write a number" p "Q to stop" the_replay = gets.chomp end def do_exit p "Bye bye" exit end while 1 == 1 do the_reply = menu case the_reply when "q" then do_exit when "Q" then do_exit end p the_reply end -- Posted via http://www.ruby-forum.com/.