Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!luvthang.aquin.ori-cal.COM!talmage From: talmage@luvthang.aquin.ori-cal.COM (David W. Talmage) Newsgroups: comp.lang.icon Subject: Re: Case statements and string scanning Message-ID: <9102271247.AA01743@luvthang.aquin.ori-cal.com> Date: 27 Feb 91 12:47:12 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 37 :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. How about using ipp, the Icon Pre-Processor that comes with the Icon Program Library? You could do something like this: $define IF(x) if x $define THEN { $define ELSEIF(x) } else if (x) { $define ELSE } { $define ENDIF } IF (test1) THEN . ELSEIF (test2) THEN . ELSEIF (test3) THEN . ELSE . ENDIF ----------------------------------------------------------------------------- David W. Talmage (talmage@luvthang.aquin.ori-cal.com) "I need fifty dollars to make you hollar. I get paid to run this luvthang."