From: Chris Bailey Date: 2008-08-29T04:27:15+09:00 Subject: Re: Having a difficult time with Case statements. Sebastian Hungerecker wrote: > Michael W. Ryder wrote: >> From the looks of the code that I was tracing selecting '2' would set >> the state to '1' which was the next step in the case statement. > > Yes, but selecting 1, sets the state to 4, so in that case he would not > want > 1,2 and 3 to execute. > I'm pretty sure he simply expected an implicit while true loop around > the case > statement. I'm not one hundred percent sure what either of you believe I wanted but I will do my best to explain =) The first case prints a list of 4 options that you may choose to perform. You can only choose one and the corresponding case should be the only one that is performed. The entire system wasn't fully in place yet but the only time you would be back at the first menu is if you chose to load a character and were unable to for whatever reason. The "character creation" System would step through each case 1 at a time but repeat itself if conditions for progressing to the next step were not met. As it is written it works perfectly(as far as I can tell) when put into a startUp() method and placed inside a loop. The loop breaks when case 4 conditions are met. -- Posted via http://www.ruby-forum.com/.