Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ucla-cs!cognet.ucla.edu!cogdev.cognet.ucla.edu!earl From: earl@cogdev.cognet.ucla.edu (Earl Williams) Newsgroups: comp.sys.mac.hypercard Subject: Why no 'case' statement in Hypertalk? Suggestions? Message-ID: <1991Jun4.234844.1280@cognet.ucla.edu> Date: 4 Jun 91 23:48:44 GMT Sender: news@cognet.ucla.edu Reply-To: earl@cogdev.cognet.ucla.edu (Earl Williams) Organization: UCLA Cognitive Science Program Lines: 34 Is there really no 'case' statement in Hypertalk, or am I missing its equivalent? For simple keypress trapping, I'd like to do something like the following: on keyDown key case key = 'a' then do this else key = 'b' then do that else key = 'c' then do the other end end keyDown Instead, I have to use standard if-then-else statements which, when formatted, give the false impression that I'm doing nesting. on keyDown key if key = 'a' then do this else if key = 'b' then do that else if key = 'c' then do the other end if end if end if end keyDown This is extremely inelegant, if not confusing (when used in a more complex example than this, of course. Any suggestions? What am I missing here? Any help will be much appreciated. ----------------------------------------------------------- Earl M. Williams ?8-) UCLA Psychology Department earl@cognet.ucla.edu 2344B Franz Hall "No matter where you go, there you are." -Buckaroo Banzai