Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!aunro!ukma!rex!samsung!uakari.primate.wisc.edu!sdd.hp.com!mips!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!njin!princeton!siemens!pollux!fwb From: fwb@pollux.tmc.edu (Fred Brehm) Newsgroups: comp.sys.mac.hypercard Subject: Re: Why no 'case' statement in Hypertalk? Suggestions? Message-ID: <62676@siemens.siemens.com> Date: 6 Jun 91 13:33:40 GMT References: <1991Jun4.234844.1280@cognet.ucla.edu> Sender: news@siemens.siemens.com Organization: Siemens Corporate Research Lines: 27 In article <1991Jun4.234844.1280@cognet.ucla.edu> earl@cogdev.cognet.ucla.edu (Earl Williams) writes: >Is there really no 'case' statement in Hypertalk, or am I missing its >equivalent? The equivalent is "else if" > ... 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 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 keyDown -- Frederic W. Brehm Siemens Corporate Research Princeton, NJ fwb@demon.siemens.com -or- ...!princeton!siemens!demon!fwb