From: Tim Romberg Date: 2010-09-12T05:42:07+09:00 Subject: Re: Why does my program exit?! David A. Black wrote: > Hi -- > > On Sun, 12 Sep 2010, Tim Romberg wrote: > >>>> presented in the menus. It worked before but now when I started adding >>>> features for it(its for an assignment for a course) now it just presents >>>> the menu and then exits the program. Can anyone help me with this. I >>>> will post the code below and hopefully someone with more programming >>>> skills than me can see the problem. Thanks! >>> >>> Let me turn the question around: why would you expect it not to exit? At >>> what point are you telling it to wait for user input? >> >> Yes I know. I just were not sure how to incorporate the user input in a >> good way. Do you have any tips?! > > Several, but I'm a bit skittish about directly answering questions that > are for homework assignments without knowing the details a little more > (whether it's for a grade, etc.). Chalk it up to my many years as a > professor :-) > > > David > > -- > David A. Black, Senior Developer, Cyrus Innovation Inc. > > The Ruby training with Black/Brown/McAnally > Compleat Philadelphia, PA, October 1-2, 2010 > Rubyist http://www.compleatrubyist.com ok, well before I was reading the input like this def self.menu puts "---------------------------" puts " Menu" puts " 1. Checkin" puts " 2. Checkout" puts " 3. List of current guests" puts " 4. List of all guests" puts " 5. Exit" puts "" puts " What do you want to do?" puts "---------------------------" print ": " choice = get_input make_choice(choice) end But with the current upgrade Im just receiving an undefined local variable or method. So I was thinking instead something like this: @options = gets.chomp. Is that stupid. I am terribly new at Ruby. -- Posted via http://www.ruby-forum.com/.