All pastes #99752 Raw Edit

Mine

public text v1 · immutable
#99752 ·published 2006-07-25 16:27 UTC
rendered paste body
switch(object)
{
	case(bar):
		// only bar
		bar.fooiffize();
	case(cookie):
		// cookie is a foo!
		fall(bar,tar,foo); // fall to the statement matching that (which can only ever be one anyway)
	case(tar):
		// only tar
		tar.fooiffize();
	case(foo2):
		fall; // fall to the statement directly below
	case(bar,tar,foo):
		// bar tar cookie foo2 and foo
		printf("object is a foo");
}

switch(sillyCenum)
{
	case(keyf): fall;
	case(keyk): fall;
	case(keyn): fall;
	case(keyz):
		handleKey(sillyCenum);
	
	// OR
	case(keyf,keyk,keyn,keyz):
		handleKey(sillyCenum);

	default:
		//whatever wasn't matched by any of the former
}