(Or CASe statement, multi-way branch) A construct found in most high-level languages for selecting one of several possible blocks of code or branch destinations depending on the value of an expression. An example in C is switch (foo(x, y)) { CASe 1: printf("Hello
") /* fall through */ CASe 2: printf("Goodbye
") break CASe 3: printf("Fish
") break default: fprintf(stderr, "Odd foo value
") exit(1) } The break statements cause execution to continue after the whole switch statemetnt. The lack of a break statement after the first CASe means that execution will fall through into the second CASe. Since this is a common programming error you should add a comment if it is intentional. If none of the explicit CASes matches the expression value then the (optional) default CASe is taken. A similar construct in some functional languages returns the value of one of several expressions selected according to the value of the first expression. A distant relation to the modern switch statement is Fortran' s computed goto. (1997-01-30)