switch break

Kevin D. Quitt kdq at demott.COM
Sat Oct 6 06:22:39 AEST 1990


In article <ENAG.90Oct4022413 at hild.ifi.uio.no> enag at ifi.uio.no (Erik Naggum) writes:
>In article <1990Oct3.160403.517 at Neon.Stanford.EDU> dkeisen at Gang-of-Four.Stanford.EDU (Dave Eisen) writes:
>
>   Besides, it always seems silly to me to have to write break a dozen
>   times in a long switch to do what in my mind is the canonical 
>   operation.
>
>May I suggest
>
>	#define Case break; case

    Perhaps even better (because it won't annoy the maintenance
programmer) is to define yourself an editor macro called something like
"make-switch-case" which inserts the "case :<NL> and "break;" (properly
tabified, of course), and leaves your cursor in front of the colon.  This
does assume you are using a reasonable editor. 

-- 
 _
Kevin D. Quitt         demott!kdq   kdq at demott.com
DeMott Electronics Co. 14707 Keswick St.   Van Nuys, CA 91405-1266
VOICE (818) 988-4975   FAX (818) 997-1190  MODEM (818) 997-4496 PEP last

                96.37% of all statistics are made up.



More information about the Comp.lang.c mailing list