Although all the variable manipulations that have been covered thus far are wonderful, they leave much to be desired in terms of a real programming language. For that, you need control structures. Control structures are a facility that allows you to control the behavior of your programs. Control structures enable you to specify the circumstances under which code will be executed, generally based on the current state of the script. Often, they can even be (roughly at least) translated from plain English. To illustrate this, consider what is called a conditional statement in programming:
"If John finishes 15 pages of his book, then he can sleep."
How can this logic be transformed into a computer program that can tell me when it's all right for me to go to sleep? To compare how many pages I've written to how many I need to complete, I'll need to use the if statement. The if statement is unlike anything covered thus far and takes the following general form: