FANDOM


 This page explains a basic Pascal instruction. If you want to see how to make your own instructions, see Procedures and Functions.
This article is part of the Getting Started series

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 <variable> of
<element1>: command(s)
<element2>: command(s)
<element3>: command(s)
...................
<elementN>: 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.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.