CASE

GS undefined In early programming, a common problem was met. If there were many choices to make and many conditions to test, then programmers had to use lots of IF's and programming became annoying. Pascal, just like C did, has an instruction for solving this problem. It's name is CASE. This verifies if a variable is equal to a list of elements. The sintax is: case of : command(s) : command(s) : command(s) ................... : command(s) end else command(s)

The else is optional but end; is mandatory even if else is not met.

See Script:Opperations with numbers for an example.

From Borland Pascal Wiki, a Wikia wiki.