Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!dog.ee.lbl.gov!ucbvax!edinburgh.ac.uk!R.J.Hare From: R.J.Hare@edinburgh.ac.uk Newsgroups: comp.lang.icon Subject: Case statements and string scanning Message-ID: <26.Feb.91..12:24:40.gmt..060488@EMAS-A> Date: 26 Feb 91 12:24:40 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 42 Thanks to those who replied. The method involving paired tests and operations seems an intersting idea, I shall certainly try it out when I get a chance. RGs comments on the use of if statements highlight the 'problem'. If I do if expr1 then ... if expr2 then ... if expr3 then ... obviously with varied 'expr's, I could have more than one block of code being executed when I only want one. The alternative: if expr1 then ... else if expr2 then ... else if expr3 then ... else ... is fine but awful hard to read (which is the part I am unhappy about). What is really needed is something like the Fortran ELSEIF construct: IF (test1) THEN . ELSEIF (test2) THEN . ELSEIF (test3) THEN . ELSE . ENDIF which is only a case statement with a different hat on. Is there such a thing in Icon (ie: have I missed it?). Should there be? Roger Hare.