02.07.2013 Views

The turbo

The turbo

The turbo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10 Control Structures<br />

Score:= 10;<br />

Maximum := 32*Score div 17;<br />

Score := Score + 10;<br />

Maximum := Succ(Maximum);<br />

Part 2<br />

All but one of the control structures we'll be looking at will<br />

execute only one statement. This doesn't sound very impressive<br />

or convenient, and, in fact, it would make for a very serious<br />

limitation if you could only use procedure calls and assignment<br />

statements. Such is not the case. Pascal considers the following<br />

structure to be a single statement:<br />

begin<br />

;<br />

;<br />

<br />

end;<br />

This structure is known as a block or compound statement. It can<br />

be used anywhere that a simple statement can; you can even use<br />

one block statement within another. Compound statements are<br />

most often used in conjunction with control structures, as you'll<br />

soon see.<br />

-Blocks (compound structuresJ-<br />

10-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!