On Fri, Jul 12, 2002 at 05:41:06AM -0700, Mathew Earle Reuther wrote: > I'd like to go ahead and allow myself the opportunity to move from one con > state back to the previous one. Particularly for folks to move backwards > out of race to sex, and out of class back to race. I'm having trouble > getting this to happen as parse_race and parse_class require returning a > value. [specifics snipped for brevity] There is no "move forward" or "back up" with con states. They are not in any particular linear order as far as the code is concerned. When exiting any state in the nanny you can proceed to any other you want simply bu altering the end of its case block. Just put a conditional at the end to check the value of the previous input. If it was your "back up" choice then re-print the text for the previous state and switch to it. If it was anything else print the text for the next con state and switch to it. Look at the character name verification portion of the nanny to see similar code in action. Now if you want to be clean about it you may need to move more of the inline string constants to a header file so you don't have to duplicate them within nanny. And if you really are careful to put your states in numerical order you might consider incrementing and decrementing. Of course this *will* mostly relegate you to a linear step in either direction during the character creation sequence, but it will also help organize your otherwise convoluted nanny. -- { IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657); SMTP(fungi@yuggoth.org); IRC(fungi@irc.yuggoth.org#ccl); ICQ(114362511); AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(fungi@yuggoth.org); MUD(Nergel@mud.yuggoth.org:2325); WWW(http://fungi.yuggoth.org/); } -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | | Newbie List: http://groups.yahoo.com/group/circle-newbies/ | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/25/03 PDT