home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15966 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  870 b 

  1. Path: sparky!uunet!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Simple C shell ? regarding switch
  5. Date: 26 Jan 1993 19:56:28 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 20
  8. Message-ID: <1k451cINNcqf@early-bird.think.com>
  9. References: <1k2f0bINNjdi@darkstar.UCSC.EDU>
  10. NNTP-Posting-Host: telecaster.think.com
  11.  
  12. In article <1k2f0bINNjdi@darkstar.UCSC.EDU> caedmon@cats.ucsc.edu (Jeff A Ishaq) writes:
  13. >I assume the reason this doesn't work is I need to do something 'special'
  14. >to 1:  -- something like '1': ?  Ideas?
  15.  
  16. No, you have to put the keyword "case" before the case labels, e.g.
  17.  
  18. switch ($selection)
  19.   case 1:
  20.     ...
  21.   case 2:
  22.     ...
  23.   ...
  24.   default:
  25.     ...
  26. endsw
  27. -- 
  28. Barry Margolin
  29. System Manager, Thinking Machines Corp.
  30.  
  31. barmar@think.com          {uunet,harvard}!think!barmar
  32.